Skip to content

Commit 97978c4

Browse files
fixing samples (Azure#18310)
1 parent ec58f5b commit 97978c4

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

sdk/tables/azure-data-tables/samples/async_samples/sample_insert_delete_entities_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ async def clean_up(self):
9999
tsc = TableServiceClient.from_connection_string(self.connection_string)
100100
async with tsc:
101101
async for table in tsc.list_tables():
102-
await tsc.delete_table(table.table_name)
102+
await tsc.delete_table(table.name)
103103

104104
print("Cleaned up")
105105

sdk/tables/azure-data-tables/samples/async_samples/sample_query_tables_async.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async def tables_in_account(self):
5353
# List all the tables in the service
5454
print("Listing tables:")
5555
async for table in table_service.list_tables():
56-
print("\t{}".format(table.table_name))
56+
print("\t{}".format(table.name))
5757
# [END tsc_list_tables]
5858

5959
# [START tsc_query_tables]
@@ -62,7 +62,7 @@ async def tables_in_account(self):
6262
name_filter = "TableName eq '{}'".format(table_name)
6363
print("Queried_tables")
6464
async for table in table_service.query_tables(name_filter):
65-
print("\t{}".format(table.table_name))
65+
print("\t{}".format(table.name))
6666
# [END tsc_query_tables]
6767

6868
finally:
@@ -84,7 +84,7 @@ async def clean_up(self):
8484
tsc = TableServiceClient.from_connection_string(self.connection_string)
8585
async with tsc:
8686
async for table in tsc.list_tables():
87-
await tsc.delete_table(table.table_name)
87+
await tsc.delete_table(table.name)
8888

8989
print("Cleaned up")
9090

sdk/tables/azure-data-tables/samples/async_samples/sample_update_upsert_merge_entities_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ async def clean_up(self):
161161

162162
async with tsc:
163163
async for table in tsc.list_tables():
164-
await tsc.delete_table(table.table_name)
164+
await tsc.delete_table(table.name)
165165

166166
print("Cleaned up")
167167

sdk/tables/azure-data-tables/samples/sample_create_delete_table.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ def delete_table(self):
7575
# [END delete_table_from_tc]
7676

7777
def create_from_table_client(self):
78-
from azure.data.table import TableClient
78+
from azure.data.tables import TableClient
7979

8080
# [START create_table_from_table_client]
8181
with TableClient.from_connection_string(conn_str=self.connection_string, table_name="myTable") as table_client:
8282
try:
8383
table_item = table_client.create_table()
84-
print("Created table {}!".format(table_item.table_name))
84+
print("Created table {}!".format(table_item.name))
8585
except ResourceExistsError:
8686
print("Table already exists")
8787
# [END create_table_from_table_client]

sdk/tables/azure-data-tables/samples/sample_query_tables.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def tables_in_account(self):
5555
list_tables = table_service.list_tables()
5656
print("Listing tables:")
5757
for table in list_tables:
58-
print("\t{}".format(table.table_name))
58+
print("\t{}".format(table.name))
5959
# [END tsc_list_tables]
6060

6161
# [START tsc_query_tables]
@@ -65,7 +65,7 @@ def tables_in_account(self):
6565

6666
print("Queried_tables")
6767
for table in queried_tables:
68-
print("\t{}".format(table.table_name))
68+
print("\t{}".format(table.name))
6969
# [END tsc_query_tables]
7070

7171
finally:

0 commit comments

Comments
 (0)