From 2b29cb37a46a5a865dd94a929650423dd9ddd539 Mon Sep 17 00:00:00 2001 From: Sean Kane <68240067+seankane-msft@users.noreply.github.com> Date: Mon, 5 Oct 2020 12:16:44 -0700 Subject: [PATCH] =?UTF-8?q?small=20changes=20to=20documentation,=20updated?= =?UTF-8?q?=20link=20in=20samples=20README,=20updat=E2=80=A6=20(#14249)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …e to the CHANGELOG to reflect new release Small updates to documentation and samples caught during the release checklist. --- sdk/tables/azure-data-tables/CHANGELOG.md | 2 +- sdk/tables/azure-data-tables/samples/README.md | 2 +- .../samples/async_samples/sample_authentication_async.py | 2 +- .../sample_update_upsert_merge_entities_async.py | 2 +- .../azure-data-tables/samples/sample_authentication.py | 5 ++--- .../azure-data-tables/samples/sample_create_delete_table.py | 4 ++-- sdk/tables/azure-data-tables/samples/sample_query_tables.py | 2 +- .../samples/sample_update_upsert_merge_entities.py | 2 +- 8 files changed, 10 insertions(+), 11 deletions(-) diff --git a/sdk/tables/azure-data-tables/CHANGELOG.md b/sdk/tables/azure-data-tables/CHANGELOG.md index b4bf8c4712c8..1988e7a9b9c2 100644 --- a/sdk/tables/azure-data-tables/CHANGELOG.md +++ b/sdk/tables/azure-data-tables/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History ## 12.0.0b2 (Unreleased) - +* Adds support for Enumerable types by converting the Enum to a string before sending to the service ## 12.0.0b1 (2020-09-08) This is the first beta of the `azure-data-tables` client library. The Azure Tables client library can seamlessly target either Azure Table storage or Azure Cosmos DB table service endpoints with no code changes. diff --git a/sdk/tables/azure-data-tables/samples/README.md b/sdk/tables/azure-data-tables/samples/README.md index a91648d07aa4..272a7fd66633 100644 --- a/sdk/tables/azure-data-tables/samples/README.md +++ b/sdk/tables/azure-data-tables/samples/README.md @@ -54,7 +54,7 @@ what you can do with the Azure Data Tables client library. -[api_reference_documentation]: https://aka.ms/azsdk/python/tables/docs +[api_reference_documentation]: https://docs.microsoft.com/rest/api/storageservices/table-service-rest-api [sample_authentication]:https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/tables/azure-data-tables/samples/sample_authentication.py [sample_authentication_async]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/tables/azure-data-tables/samples/async_samples/sample_authentication_async.py diff --git a/sdk/tables/azure-data-tables/samples/async_samples/sample_authentication_async.py b/sdk/tables/azure-data-tables/samples/async_samples/sample_authentication_async.py index c44cc9584834..0d353d2c14ba 100644 --- a/sdk/tables/azure-data-tables/samples/async_samples/sample_authentication_async.py +++ b/sdk/tables/azure-data-tables/samples/async_samples/sample_authentication_async.py @@ -71,7 +71,7 @@ async def authentication_by_shared_access_signature(self): ) async with TableServiceClient(account_url=self.account_url, credential=sas_token) as token_auth_table_service: - properties = await table_service.get_service_properties() + properties = await token_auth_table_service.get_service_properties() print("Shared Access Signature: {}".format(properties)) # [END auth_by_sas] 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 ef1f83bd5961..8eae59f73209 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 @@ -78,7 +78,7 @@ async def list_all_entities(self): async for e in table.list_entities(): entities.append(e) - for entity, i in enumerate(entities): + for i, entity in enumerate(entities): print("Entity #{}: {}".format(entity, i)) # [END list_entities] diff --git a/sdk/tables/azure-data-tables/samples/sample_authentication.py b/sdk/tables/azure-data-tables/samples/sample_authentication.py index 448a1a6fbbc5..92c76e6467a2 100644 --- a/sdk/tables/azure-data-tables/samples/sample_authentication.py +++ b/sdk/tables/azure-data-tables/samples/sample_authentication.py @@ -58,10 +58,9 @@ def authentication_by_shared_key(self): def authentication_by_shared_access_signature(self): # Instantiate a TableServiceClient using a connection string from azure.data.tables import TableServiceClient - table_service = TableServiceClient.from_connection_string(conn_str=self.connection_string) - # Create a SAS token to use for authentication of a client # [START auth_from_sas] + # Create a SAS token to use for authentication of a client from azure.data.tables import generate_account_sas, ResourceTypes, AccountSasPermissions print(self.account_name) sas_token = generate_account_sas( @@ -74,7 +73,7 @@ def authentication_by_shared_access_signature(self): token_auth_table_service = TableServiceClient(account_url=self.account_url, credential=sas_token) - properties = table_service.get_service_properties() + properties = token_auth_table_service.get_service_properties() print("Shared Access Signature: {}".format(properties)) # [END auth_from_sas] 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 0e0b56fbb3ac..f3b1b371dabc 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 @@ -93,8 +93,8 @@ def delete_from_table_client(self): try: table_client.delete_table() print("Deleted table {}!".format(self.table_name)) - except ResourceExistsError: - print("Table already exists") + except ResourceNotFoundError: + print("Table could not be found") # [END delete_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 360599954a13..ec6ac648f608 100644 --- a/sdk/tables/azure-data-tables/samples/sample_query_tables.py +++ b/sdk/tables/azure-data-tables/samples/sample_query_tables.py @@ -49,7 +49,7 @@ def tables_in_account(self): # [START tsc_query_tables] table_name = "mytable1" name_filter = "TableName eq '{}'".format(table_name) - queried_tables = table_service.query_tables(filter=name_filter, results_per_page=10) + queried_tables = table_service.query_tables(filter=name_filter) print("Queried_tables") for table in queried_tables: diff --git a/sdk/tables/azure-data-tables/samples/sample_update_upsert_merge_entities.py b/sdk/tables/azure-data-tables/samples/sample_update_upsert_merge_entities.py index 4000983092cb..43d3ba07e5f4 100644 --- a/sdk/tables/azure-data-tables/samples/sample_update_upsert_merge_entities.py +++ b/sdk/tables/azure-data-tables/samples/sample_update_upsert_merge_entities.py @@ -78,7 +78,7 @@ def list_all_entities(self): # Query the entities in the table entities = list(table.list_entities()) - for entity, i in enumerate(entities): + for i, entity in enumerate(entities): print("Entity #{}: {}".format(entity, i)) # [END query_entities]