From 97978c41e2939aa73fb6e7fec905896c296f9114 Mon Sep 17 00:00:00 2001 From: Sean Kane <68240067+seankane-msft@users.noreply.github.com> Date: Mon, 26 Apr 2021 16:24:25 -0400 Subject: [PATCH] fixing samples (#18310) --- .../async_samples/sample_insert_delete_entities_async.py | 2 +- .../samples/async_samples/sample_query_tables_async.py | 6 +++--- .../sample_update_upsert_merge_entities_async.py | 2 +- .../azure-data-tables/samples/sample_create_delete_table.py | 4 ++-- sdk/tables/azure-data-tables/samples/sample_query_tables.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sdk/tables/azure-data-tables/samples/async_samples/sample_insert_delete_entities_async.py b/sdk/tables/azure-data-tables/samples/async_samples/sample_insert_delete_entities_async.py index 3b6f9df125b4..1fa6febf5e0f 100644 --- a/sdk/tables/azure-data-tables/samples/async_samples/sample_insert_delete_entities_async.py +++ b/sdk/tables/azure-data-tables/samples/async_samples/sample_insert_delete_entities_async.py @@ -99,7 +99,7 @@ async def clean_up(self): tsc = TableServiceClient.from_connection_string(self.connection_string) async with tsc: async for table in tsc.list_tables(): - await tsc.delete_table(table.table_name) + await tsc.delete_table(table.name) print("Cleaned up") diff --git a/sdk/tables/azure-data-tables/samples/async_samples/sample_query_tables_async.py b/sdk/tables/azure-data-tables/samples/async_samples/sample_query_tables_async.py index 0e910cfeefa2..7417d8b6fdea 100644 --- a/sdk/tables/azure-data-tables/samples/async_samples/sample_query_tables_async.py +++ b/sdk/tables/azure-data-tables/samples/async_samples/sample_query_tables_async.py @@ -53,7 +53,7 @@ async def tables_in_account(self): # List all the tables in the service print("Listing tables:") async for table in table_service.list_tables(): - print("\t{}".format(table.table_name)) + print("\t{}".format(table.name)) # [END tsc_list_tables] # [START tsc_query_tables] @@ -62,7 +62,7 @@ async def tables_in_account(self): name_filter = "TableName eq '{}'".format(table_name) print("Queried_tables") async for table in table_service.query_tables(name_filter): - print("\t{}".format(table.table_name)) + print("\t{}".format(table.name)) # [END tsc_query_tables] finally: @@ -84,7 +84,7 @@ async def clean_up(self): tsc = TableServiceClient.from_connection_string(self.connection_string) async with tsc: async for table in tsc.list_tables(): - await tsc.delete_table(table.table_name) + await tsc.delete_table(table.name) print("Cleaned up") diff --git a/sdk/tables/azure-data-tables/samples/async_samples/sample_update_upsert_merge_entities_async.py b/sdk/tables/azure-data-tables/samples/async_samples/sample_update_upsert_merge_entities_async.py index f0679bef9b44..e27e87404f18 100644 --- a/sdk/tables/azure-data-tables/samples/async_samples/sample_update_upsert_merge_entities_async.py +++ b/sdk/tables/azure-data-tables/samples/async_samples/sample_update_upsert_merge_entities_async.py @@ -161,7 +161,7 @@ async def clean_up(self): async with tsc: async for table in tsc.list_tables(): - await tsc.delete_table(table.table_name) + await tsc.delete_table(table.name) print("Cleaned up") diff --git a/sdk/tables/azure-data-tables/samples/sample_create_delete_table.py b/sdk/tables/azure-data-tables/samples/sample_create_delete_table.py index 5e1e8ef77449..019d8c3599e2 100644 --- a/sdk/tables/azure-data-tables/samples/sample_create_delete_table.py +++ b/sdk/tables/azure-data-tables/samples/sample_create_delete_table.py @@ -75,13 +75,13 @@ def delete_table(self): # [END delete_table_from_tc] def create_from_table_client(self): - from azure.data.table import TableClient + from azure.data.tables import TableClient # [START create_table_from_table_client] with TableClient.from_connection_string(conn_str=self.connection_string, table_name="myTable") as table_client: try: table_item = table_client.create_table() - print("Created table {}!".format(table_item.table_name)) + print("Created table {}!".format(table_item.name)) except ResourceExistsError: print("Table already exists") # [END create_table_from_table_client] diff --git a/sdk/tables/azure-data-tables/samples/sample_query_tables.py b/sdk/tables/azure-data-tables/samples/sample_query_tables.py index 5e2a9ce9192c..f741978f61da 100644 --- a/sdk/tables/azure-data-tables/samples/sample_query_tables.py +++ b/sdk/tables/azure-data-tables/samples/sample_query_tables.py @@ -55,7 +55,7 @@ def tables_in_account(self): list_tables = table_service.list_tables() print("Listing tables:") for table in list_tables: - print("\t{}".format(table.table_name)) + print("\t{}".format(table.name)) # [END tsc_list_tables] # [START tsc_query_tables] @@ -65,7 +65,7 @@ def tables_in_account(self): print("Queried_tables") for table in queried_tables: - print("\t{}".format(table.table_name)) + print("\t{}".format(table.name)) # [END tsc_query_tables] finally: