From b65525a09a8e657d3d5d48681ed1c16d1cf1e6c9 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Wed, 26 Aug 2020 08:07:29 -0700 Subject: [PATCH 01/29] pruning tests.yml --- sdk/tables/tests.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/sdk/tables/tests.yml b/sdk/tables/tests.yml index 86573bce751d..926f28eb9a3a 100644 --- a/sdk/tables/tests.yml +++ b/sdk/tables/tests.yml @@ -6,24 +6,6 @@ jobs: BuildTargetingString: azure-data-tables ServiceDirectory: tables EnvVars: - STORAGE_ACCOUNT_NAME: $(python-storage-storage-account-name) - STORAGE_ACCOUNT_KEY: $(python-storage-storage-account-key) - STORAGE_DATA_LAKE_ACCOUNT_NAME: $(python-storage-data-lake-account-name) - STORAGE_DATA_LAKE_ACCOUNT_KEY: $(python-storage-data-lake-account-key) - BLOB_STORAGE_ACCOUNT_NAME: $(python-storage-blob-storage-account-name) - BLOB_STORAGE_ACCOUNT_KEY: $(python-storage-blob-storage-account-key) - REMOTE_STORAGE_ACCOUNT_NAME: $(python-storage-remote-storage-account-name) - REMOTE_STORAGE_ACCOUNT_KEY: $(python-storage-remote-storage-account-key) - PREMIUM_STORAGE_ACCOUNT_NAME: $(python-storage-premium-storage-account-name) - PREMIUM_STORAGE_ACCOUNT_KEY: $(python-storage-premium-storage-account-key) - OAUTH_STORAGE_ACCOUNT_NAME: $(python-storage-oauth-storage-account-name) - OAUTH_STORAGE_ACCOUNT_KEY: $(python-storage-oauth-storage-account-key) - ACTIVE_DIRECTORY_APPLICATION_ID: $(aad-azure-sdk-test-client-id) - ACTIVE_DIRECTORY_APPLICATION_SECRET: $(aad-azure-sdk-test-client-secret) - ACTIVE_DIRECTORY_TENANT_ID: $(aad-azure-sdk-test-tenant-id) - CONNECTION_STRING: $(python-storage-blob-connection-string) - BLOB_CONNECTION_STRING: $(python-storage-blob-connection-string) - PREMIUM_CONNECTION_STRING: $(python-storage-premium-connection-string) TEST_MODE: 'RunLiveNoRecord' AZURE_SKIP_LIVE_RECORDING: 'True' AZURE_TEST_RUN_LIVE: 'true' From f2d496cb2bdc5ae7a23905f4ea28272523212551 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Wed, 26 Aug 2020 08:23:46 -0700 Subject: [PATCH 02/29] potential fix --- sdk/tables/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/tables/tests.yml b/sdk/tables/tests.yml index 926f28eb9a3a..121ecfcb2d56 100644 --- a/sdk/tables/tests.yml +++ b/sdk/tables/tests.yml @@ -6,10 +6,10 @@ jobs: BuildTargetingString: azure-data-tables ServiceDirectory: tables EnvVars: - TEST_MODE: 'RunLiveNoRecord' - AZURE_SKIP_LIVE_RECORDING: 'True' - AZURE_TEST_RUN_LIVE: 'true' AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) AZURE_SUBSCRIPTION_ID: $(azure-subscription-id) AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) + TEST_MODE: 'RunLiveNoRecord' + AZURE_SKIP_LIVE_RECORDING: 'True' + AZURE_TEST_RUN_LIVE: 'true' From 501e6a5f5fac3b327656b5d6c6481072231b7f65 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Wed, 26 Aug 2020 09:21:36 -0700 Subject: [PATCH 03/29] updated environment variables --- sdk/tables/tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/tables/tests.yml b/sdk/tables/tests.yml index 121ecfcb2d56..5a078f2577a1 100644 --- a/sdk/tables/tests.yml +++ b/sdk/tables/tests.yml @@ -8,8 +8,9 @@ jobs: EnvVars: AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) AZURE_SUBSCRIPTION_ID: $(azure-subscription-id) - AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) - AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) + AZURE_ACTIVE_DIRECTORY_APPLICATION_ID: $(aad-azure-sdk-test-client-id) + AZURE_ACTIVE_DIRECTORY_APPLICATION_SECRET: $(aad-azure-sdk-test-client-secret) + AZURE_ACTIVE_DIRECTORY_TENANT_ID: $(aad-azure-sdk-test-tenant-id) TEST_MODE: 'RunLiveNoRecord' AZURE_SKIP_LIVE_RECORDING: 'True' AZURE_TEST_RUN_LIVE: 'true' From b3a8b8d22b7ea39703af6588f80e1ed1019fc09a Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Wed, 26 Aug 2020 09:36:51 -0700 Subject: [PATCH 04/29] another change to tests.yml --- sdk/tables/tests.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sdk/tables/tests.yml b/sdk/tables/tests.yml index 5a078f2577a1..fa63354a26dd 100644 --- a/sdk/tables/tests.yml +++ b/sdk/tables/tests.yml @@ -8,9 +8,11 @@ jobs: EnvVars: AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) AZURE_SUBSCRIPTION_ID: $(azure-subscription-id) - AZURE_ACTIVE_DIRECTORY_APPLICATION_ID: $(aad-azure-sdk-test-client-id) - AZURE_ACTIVE_DIRECTORY_APPLICATION_SECRET: $(aad-azure-sdk-test-client-secret) - AZURE_ACTIVE_DIRECTORY_TENANT_ID: $(aad-azure-sdk-test-tenant-id) + AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) + AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) + ACTIVE_DIRECTORY_APPLICATION_ID: $(aad-azure-sdk-test-client-id) + ACTIVE_DIRECTORY_APPLICATION_SECRET: $(aad-azure-sdk-test-client-secret) + ACTIVE_DIRECTORY_TENANT_ID: $(aad-azure-sdk-test-tenant-id) TEST_MODE: 'RunLiveNoRecord' AZURE_SKIP_LIVE_RECORDING: 'True' AZURE_TEST_RUN_LIVE: 'true' From 2ba8ce3432817e0ac2d6d4705f1107f427b83036 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Wed, 26 Aug 2020 10:34:04 -0700 Subject: [PATCH 05/29] change --- sdk/tables/tests.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sdk/tables/tests.yml b/sdk/tables/tests.yml index fa63354a26dd..ce8ea8df10dc 100644 --- a/sdk/tables/tests.yml +++ b/sdk/tables/tests.yml @@ -8,11 +8,8 @@ jobs: EnvVars: AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) AZURE_SUBSCRIPTION_ID: $(azure-subscription-id) - AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) - ACTIVE_DIRECTORY_APPLICATION_ID: $(aad-azure-sdk-test-client-id) - ACTIVE_DIRECTORY_APPLICATION_SECRET: $(aad-azure-sdk-test-client-secret) - ACTIVE_DIRECTORY_TENANT_ID: $(aad-azure-sdk-test-tenant-id) + AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) TEST_MODE: 'RunLiveNoRecord' AZURE_SKIP_LIVE_RECORDING: 'True' AZURE_TEST_RUN_LIVE: 'true' From 68d317f8a7dd2128ff1ef73f960e7b494846d3a6 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Wed, 26 Aug 2020 11:10:01 -0700 Subject: [PATCH 06/29] edits to testcase --- .../azure-data-tables/tests/_shared/testcase.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sdk/tables/azure-data-tables/tests/_shared/testcase.py b/sdk/tables/azure-data-tables/tests/_shared/testcase.py index 3dcfde01bf48..9d06aa814f3e 100644 --- a/sdk/tables/azure-data-tables/tests/_shared/testcase.py +++ b/sdk/tables/azure-data-tables/tests/_shared/testcase.py @@ -351,6 +351,8 @@ def storage_account(): i_need_to_create_rg = not (existing_rg_name or existing_storage_name or storage_connection_string) got_storage_info_from_env = existing_storage_name or storage_connection_string + storage_name = None + try: if i_need_to_create_rg: rg_name, rg_kwargs = rg_preparer._prepare_create_resource(test_case) @@ -431,11 +433,12 @@ def build_service_endpoint(service): TableTestCase._STORAGE_CONNECTION_STRING = storage_connection_string yield finally: - if not got_storage_info_from_env: - storage_preparer.remove_resource( - storage_name, - resource_group=rg - ) + if storage_name is not None: + if not got_storage_info_from_env: + storage_preparer.remove_resource( + storage_name, + resource_group=rg + ) finally: if i_need_to_create_rg: rg_preparer.remove_resource(rg_name) From 09412a2ae6ed1cc4132acf120c00b9b75d59d178 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Thu, 27 Aug 2020 05:46:19 -0700 Subject: [PATCH 07/29] setting storage_name and rg_kwargs to None to help identify problem --- sdk/tables/azure-data-tables/tests/_shared/testcase.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/tables/azure-data-tables/tests/_shared/testcase.py b/sdk/tables/azure-data-tables/tests/_shared/testcase.py index 9d06aa814f3e..7af3476c13d2 100644 --- a/sdk/tables/azure-data-tables/tests/_shared/testcase.py +++ b/sdk/tables/azure-data-tables/tests/_shared/testcase.py @@ -352,6 +352,7 @@ def storage_account(): got_storage_info_from_env = existing_storage_name or storage_connection_string storage_name = None + rg_kwargs = None try: if i_need_to_create_rg: From 767325a95ea643d1756402c27ee7187a4aa80345 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Thu, 27 Aug 2020 06:01:04 -0700 Subject: [PATCH 08/29] forcing i_need_to_create_rg to be True --- sdk/tables/azure-data-tables/tests/_shared/testcase.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/tables/azure-data-tables/tests/_shared/testcase.py b/sdk/tables/azure-data-tables/tests/_shared/testcase.py index 7af3476c13d2..74d55ed10c0a 100644 --- a/sdk/tables/azure-data-tables/tests/_shared/testcase.py +++ b/sdk/tables/azure-data-tables/tests/_shared/testcase.py @@ -348,6 +348,10 @@ def storage_account(): existing_storage_key = os.environ.get("AZURE_STORAGE_ACCOUNT_KEY") storage_connection_string = os.environ.get("AZURE_STORAGE_CONNECTION_STRING") + existing_rg_name = None + existing_storage_name = None + storage_connection_string = None + i_need_to_create_rg = not (existing_rg_name or existing_storage_name or storage_connection_string) got_storage_info_from_env = existing_storage_name or storage_connection_string From 13b94535a41a92217e19fdb78c7e8ca5504d0aa9 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Thu, 27 Aug 2020 06:12:34 -0700 Subject: [PATCH 09/29] flirting with version change --- sdk/tables/azure-data-tables/azure/data/tables/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_version.py b/sdk/tables/azure-data-tables/azure/data/tables/_version.py index 71af5012673a..8d28dde2cfdb 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_version.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_version.py @@ -4,4 +4,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = '12.0.0b1' +VERSION = '2019-07-07' From 1e1014703ed6642c80cba9ca3cd4111cc26e1f1e Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Thu, 27 Aug 2020 11:28:15 -0700 Subject: [PATCH 10/29] reverting back to normal for both testcase and version --- sdk/tables/azure-data-tables/azure/data/tables/_version.py | 2 +- sdk/tables/azure-data-tables/tests/_shared/testcase.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_version.py b/sdk/tables/azure-data-tables/azure/data/tables/_version.py index 8d28dde2cfdb..71af5012673a 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_version.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_version.py @@ -4,4 +4,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = '2019-07-07' +VERSION = '12.0.0b1' diff --git a/sdk/tables/azure-data-tables/tests/_shared/testcase.py b/sdk/tables/azure-data-tables/tests/_shared/testcase.py index 74d55ed10c0a..7af3476c13d2 100644 --- a/sdk/tables/azure-data-tables/tests/_shared/testcase.py +++ b/sdk/tables/azure-data-tables/tests/_shared/testcase.py @@ -348,10 +348,6 @@ def storage_account(): existing_storage_key = os.environ.get("AZURE_STORAGE_ACCOUNT_KEY") storage_connection_string = os.environ.get("AZURE_STORAGE_CONNECTION_STRING") - existing_rg_name = None - existing_storage_name = None - storage_connection_string = None - i_need_to_create_rg = not (existing_rg_name or existing_storage_name or storage_connection_string) got_storage_info_from_env = existing_storage_name or storage_connection_string From cd8ecca8946acbdffb16eed7b50a2a20c9f977f9 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot Date: Thu, 27 Aug 2020 20:07:23 +0000 Subject: [PATCH 11/29] Packaging update of azure-data-tables --- sdk/tables/azure-data-tables/MANIFEST.in | 5 +- sdk/tables/azure-data-tables/README.md | 302 +----------------- .../azure-data-tables/azure/__init__.py | 2 +- .../azure-data-tables/azure/data/__init__.py | 2 +- .../azure-data-tables/sdk_packaging.toml | 8 + sdk/tables/azure-data-tables/setup.py | 40 ++- 6 files changed, 47 insertions(+), 312 deletions(-) create mode 100644 sdk/tables/azure-data-tables/sdk_packaging.toml diff --git a/sdk/tables/azure-data-tables/MANIFEST.in b/sdk/tables/azure-data-tables/MANIFEST.in index 428787a39347..9fd2bc9d0339 100644 --- a/sdk/tables/azure-data-tables/MANIFEST.in +++ b/sdk/tables/azure-data-tables/MANIFEST.in @@ -1,6 +1,5 @@ +recursive-include tests *.py *.yaml include *.md include azure/__init__.py include azure/data/__init__.py -include LICENSE.txt -recursive-include tests *.py -recursive-include samples *.py *.md + diff --git a/sdk/tables/azure-data-tables/README.md b/sdk/tables/azure-data-tables/README.md index a29e4d753e2c..027137475936 100644 --- a/sdk/tables/azure-data-tables/README.md +++ b/sdk/tables/azure-data-tables/README.md @@ -1,299 +1,21 @@ -# Azure Data Tables client library for Python +# Microsoft Azure SDK for Python -Azure Data Tables is a NoSQL data storing service that can be accessed from anywhere in the world via authenticated calls using HTTP or HTTPS. -Tables scale as needed to support the amount of data inserted, and allow for the storing of data with non-complex accessing. -Tables scale as needed to support the amount of data inserted, and allow for the storing of data with non-complex accessing. -The Azure Data Tables client can be used to access Azure Storage or Cosmos accounts. +This is the Microsoft Azure MyService Management Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). -Common uses of Azure Data Tables include: -* Storing structured data in the form of tables -* Quickly querying data using a clustered index +# Usage -[Source code](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) | [Package (PyPI)](https://pypi.org) | [API reference documentation](https://aka.ms/azsdk/python/tables/docs) | [Product documentation](https://docs.microsoft.com/azure/storage/) | [Samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) +For code examples, see [MyService Management](https://docs.microsoft.com/python/api/overview/azure/) +on docs.microsoft.com. -## Getting started -### Prerequisites -* Python 2.7, or 3.5 or later is required to use this package. -* You must have an [Azure subscription](https://azure.microsoft.com/free/) and an -[Azure storage account](https://docs.microsoft.com/azure/storage/common/storage-account-overview) to use this package - or you must have a [Azure Cosmos Account](https://docs.microsoft.com/azure/cosmos-db/account-overview). +# Provide Feedback -### Install the package -Install the Azure Data Tables client library for Python with [pip](https://pypi.org/project/pip/): +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. -```bash -pip install --pre azure-data-tables -``` -### Create a storage account -If you wish to create a new cosmos storage account, you can use the [Azure Cosmos DB](https://docs.microsoft.com/azure/cosmos-db/create-cosmosdb-resources-portal) -If you wish to create a new storage account, you can use the -[Azure Portal](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal), -[Azure PowerShell](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell), -or [Azure CLI](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli): - -```bash -# Create a new resource group to hold the storage account - -# if using an existing resource group, skip this step -az group create --name MyResourceGroup --location westus2 - -# Create the storage account -az storage account create -n mystorageaccount -g MyResourceGroup -``` - -### Create the client -The Azure Data Tables client library for Python allows you to interact with two types of resources: the -account and tables, and entities. Interaction with these resources starts with an instance of a [client](#clients). -To create a client object, you will need the account's table service endpoint URL and a credential that allows -you to access the account: - -```python -from azure.data.tables import TableServiceClient - -service = TableServiceClient(account_url="https://.table.core.windows.net/", credential=credential) -``` - -#### Looking up the account URL -You can find the account's table service URL using the -[Azure Portal](https://docs.microsoft.com/azure/storage/common/storage-account-overview#storage-account-endpoints), -[Azure PowerShell](https://docs.microsoft.com/powershell/module/az.storage/get-azstorageaccount), -or [Azure CLI](https://docs.microsoft.com/cli/azure/storage/account?view=azure-cli-latest#az-storage-account-show): - -```bash -# Get the table service URL for the account -az storage account show -n mystorageaccount -g MyResourceGroup --query "primaryEndpoints.table" -``` - -#### Types of credentials -The `credential` parameter may be provided in a number of different forms, depending on the type of -[authorization](https://docs.microsoft.com/azure/storage/common/storage-auth) you wish to use: -1. To use a [shared access signature (SAS) token](https://docs.microsoft.com/azure/storage/common/storage-sas-overview), - provide the token as a string. If your account URL includes the SAS token, omit the credential parameter. - You can generate a SAS token from the Azure Portal under "Shared access signature" or use one of the `generate_sas()` - functions to create a sas token for the account or table: - -```python - from datetime import datetime, timedelta - from azure.data.tables import TableServiceClient, generate_account_sas, ResourceTypes, AccountSasPermissions - - sas_token = generate_account_sas( - account_name="", - account_key="", - resource_types=ResourceTypes(service=True), - permission=AccountSasPermissions(read=True), - expiry=datetime.utcnow() + timedelta(hours=1) - ) - - table_service_client = TableServiceClient(account_url="https://.table.core.windows.net", credential=sas_token) -``` - -2. To use an account [shared key](https://docs.microsoft.com/rest/api/storageservices/authenticate-with-shared-key/) - (aka account key or access key), provide the key as a string. This can be found in the Azure Portal under the "Access Keys" - section or by running the following Azure CLI command: - - ```az storage account keys list -g MyResourceGroup -n mystorageaccount``` - - Use the key as the credential parameter to authenticate the client: - ```python - from azure.data.tables import TableServiceClient - service = TableServiceClient(account_url="https://.table.core.windows.net", credential="") - ``` - -#### Creating the client from a connection string -Depending on your use case and authorization method, you may prefer to initialize a client instance with a -connection string instead of providing the account URL and credential separately. To do this, pass the -connection string to the client's `from_connection_string` class method: - -```python -from azure.data.tables import TableServiceClient - -connection_string = "DefaultEndpointsProtocol=https;AccountName=xxxx;AccountKey=xxxx;EndpointSuffix=core.windows.net" -service = TableServiceClient.from_connection_string(conn_str=connection_string) -``` - -The connection string to your account can be found in the Azure Portal under the "Access Keys" section or by running the following CLI command: - -```bash -az storage account show-connection-string -g MyResourceGroup -n mystorageaccount -``` - -## Key concepts -The following components make up the Azure Data Tables Service: -* The account -* A table within the account, which contains a set of entities -* An entity within a table, as a dictionary - -The Azure Data Tables client library for Python allows you to interact with each of these components through the -use of a dedicated client object. - -### Clients -Two different clients are provided to to interact with the various components of the Table Service: -1. [TableServiceClient](https://aka.ms/azsdk/python/tables/docs) - - this client represents interaction with the Azure account itself, and allows you to acquire preconfigured - client instances to access the tables within. It provides operations to retrieve and configure the account - properties as well as query, create, and delete tables within the account. To perform operations on a specific table, - retrieve a client using the `get_table_client` method. -2. [TableClient](https://aka.ms/azsdk/python/tables/docs) - - this client represents interaction with a specific table (which need not exist yet). It provides operations to - create, delete, or update a table and includes operations to query, get, and upsert entities - within it. - -### Entities -* **Create** - Adds an entity to the table. -* **Delete** - Deletes an entity from the table. -* **Update** - Updates an entities information by either merging or replacing the existing entity. -* **Query** - Queries existing entities in a table based off of the QueryOptions (OData). -* **Get** - Gets a specific entity from a table by partition and row key. -* **Upsert** - Merges or replaces an entity in a table, or if the entity does not exist, inserts the entity. - -## Examples - -The following sections provide several code snippets covering some of the most common Table tasks, including: - -* [Creating a table](#creating-a-table "Creating a table") -* [Creating entities](#creating-entities "Creating entities") -* [Querying entities](#querying-entities "Querying entities") - - -### Creating a table -Create a table in your account - -```python -from azure.data.tables import TableServiceClient - -table_service_client = TableServiceClient.from_connection_string(conn_str="") -table_service_client.create_table(table_name="myTable") -``` - -### Creating entities -Create entities in the table - -```python -from azure.data.tables import TableClient - -my_entity = {'PartitionKey':'part','RowKey':'row'} - -table_client = TableClient.from_connection_string(conn_str="", table_name="myTable") -entity = table_client.create_entity(entity=my_entity) -``` - -### Querying entities -Querying entities in the table - -```python -from azure.data.tables import TableClient - -my_filter = "text eq Marker" - -table_client = TableClient.from_connection_string(conn_str="", table_name="mytable") -entity = table_client.query_entities(filter=my_filter) -``` - -## Optional Configuration - -Optional keyword arguments can be passed in at the client and per-operation level. The azure-core [reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-core/latest/azure.core.html) describes available configurations for retries, logging, transport protocols, and more. - - -### Retry Policy configuration - -Use the following keyword arguments when instantiating a client to configure the retry policy: - -* __retry_total__ (int): Total number of retries to allow. Takes precedence over other counts. -Pass in `retry_total=0` if you do not want to retry on requests. Defaults to 10. -* __retry_connect__ (int): How many connection-related errors to retry on. Defaults to 3. -* __retry_read__ (int): How many times to retry on read errors. Defaults to 3. -* __retry_status__ (int): How many times to retry on bad status codes. Defaults to 3. -* __retry_to_secondary__ (bool): Whether the request should be retried to secondary, if able. -This should only be enabled of RA-GRS accounts are used and potentially stale data can be handled. -Defaults to `False`. - -### Other client / per-operation configuration - -Other optional configuration keyword arguments that can be specified on the client or per-operation. - -**Client keyword arguments:** - -* __connection_timeout__ (int): Optionally sets the connect and read timeout value, in seconds. -* __transport__ (Any): User-provided transport to send the HTTP request. - -**Per-operation keyword arguments:** - -* __raw_response_hook__ (callable): The given callback uses the response returned from the service. -* __raw_request_hook__ (callable): The given callback uses the request before being sent to service. -* __client_request_id__ (str): Optional user specified identification of the request. -* __user_agent__ (str): Appends the custom value to the user-agent header to be sent with the request. -* __logging_enable__ (bool): Enables logging at the DEBUG level. Defaults to False. Can also be passed in at -the client level to enable it for all requests. -* __headers__ (dict): Pass in custom headers as key, value pairs. E.g. `headers={'CustomValue': value}` - - -## Troubleshooting -### General -Azure Data Tables clients raise exceptions defined in [Azure Core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/README.md). -All Table service operations will throw a `HttpResponseError` on failure with helpful [error codes](https://docs.microsoft.com/rest/api/storageservices/table-service-error-codes). - -### Logging -This library uses the standard -[logging](https://docs.python.org/3/library/logging.html) library for logging. -Basic information about HTTP sessions (URLs, headers, etc.) is logged at INFO -level. - -Detailed DEBUG level logging, including request/response bodies and unredacted -headers, can be enabled on a client with the `logging_enable` argument: -```python -import sys -import logging -from azure.data.tables import TableServiceClient - -# Create a logger for the 'azure.data.tables' SDK -logger = logging.getLogger('azure.data.tables') -logger.setLevel(logging.DEBUG) - -# Configure a console output -handler = logging.StreamHandler(stream=sys.stdout) -logger.addHandler(handler) - -# This client will log detailed information about its HTTP sessions, at DEBUG level -service_client = TableServiceClient.from_connection_string("your_connection_string", logging_enable=True) -``` - -Similarly, `logging_enable` can enable detailed logging for a single operation, -even when it isn't enabled for the client: -```py -service_client.get_service_stats(logging_enable=True) -``` - -## Next steps - -Get started with our [Table samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk). - -Several Azure Data Tables Python SDK samples are available to you in the SDK's GitHub repository. These samples provide example code for additional scenarios commonly encountered while working with Tables: - -* [table_samples_authentication.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) - Examples found in this article: - * From a connection string - * From a shared access key - * From a shared access signature token -* [table_samples_service.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) - Examples found in this article: - * Get and set service properties - * List tables in a account - * Create and delete a table from the service - * Get the TableClient -* [table_samples_client.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) - Examples found in this article: - * Client creation - * Create a table - * Create and Delete entities - * Query entities - * Update entities - * Upsert entities - -### Additional documentation -For more extensive documentation on Azure Data Tables, see the [Azure Data Tables documentation](https://docs.microsoft.com/azure/storage/tables/) on docs.microsoft.com. - -## Contributing -This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. - -When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-data-tables%2FREADME.png) diff --git a/sdk/tables/azure-data-tables/azure/__init__.py b/sdk/tables/azure-data-tables/azure/__init__.py index 59cb70146572..0260537a02bb 100644 --- a/sdk/tables/azure-data-tables/azure/__init__.py +++ b/sdk/tables/azure-data-tables/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/azure/data/__init__.py b/sdk/tables/azure-data-tables/azure/data/__init__.py index 59cb70146572..0260537a02bb 100644 --- a/sdk/tables/azure-data-tables/azure/data/__init__.py +++ b/sdk/tables/azure-data-tables/azure/data/__init__.py @@ -1 +1 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/sdk_packaging.toml b/sdk/tables/azure-data-tables/sdk_packaging.toml new file mode 100644 index 000000000000..070be4db6470 --- /dev/null +++ b/sdk/tables/azure-data-tables/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-data-tables" +package_nspkg = "azure-data-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/sdk/tables/azure-data-tables/setup.py b/sdk/tables/azure-data-tables/setup.py index 9cf68df37c3d..1d9274496eb0 100644 --- a/sdk/tables/azure-data-tables/setup.py +++ b/sdk/tables/azure-data-tables/setup.py @@ -9,11 +9,11 @@ import re import os.path from io import open -from setuptools import find_packages, setup # type: ignore +from setuptools import find_packages, setup # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-data-tables" -PACKAGE_PPRINT_NAME = "Azure Data Tables" +PACKAGE_PPRINT_NAME = "MyService Management" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') @@ -25,7 +25,7 @@ try: import azure try: - ver = azure.__version__ # type: ignore + ver = azure.__version__ raise Exception( 'This package is incompatible with azure=={}. '.format(ver) + 'Uninstall it with "pip uninstall azure".' @@ -36,25 +36,32 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, '_version.py'), 'r') as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', # type: ignore +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) if not version: raise RuntimeError('Cannot find version information') +with open('README.md', encoding='utf-8') as f: + readme = f.read() +with open('CHANGELOG.md', encoding='utf-8') as f: + changelog = f.read() + setup( name=PACKAGE_NAME, version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), - long_description='\n\n', + long_description=readme + '\n\n' + changelog, long_description_content_type='text/markdown', license='MIT License', author='Microsoft Corporation', - author_email='ascl@microsoft.com', - url='https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/table/azure-table', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', classifiers=[ - "Development Status :: 4 - Beta", + 'Development Status :: 4 - Beta', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', @@ -67,18 +74,17 @@ ], zip_safe=False, packages=find_packages(exclude=[ + 'tests', # Exclude packages that will be covered by PEP420 or nspkg 'azure', - 'tests', + 'azure.data', ]), install_requires=[ - "azure-core<2.0.0,>=1.2.2", - "msrest>=0.6.10" - # azure-data-tables + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', ], extras_require={ - ":python_version<'3.0'": ['futures'], - ":python_version<'3.4'": ['enum34>=1.0.4'], - ":python_version<'3.5'": ["typing"] - }, + ":python_version<'3.0'": ['azure-data-nspkg'], + } ) From c7265d66ad2ddfefcf83397a4b903c6582b4d93d Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Fri, 28 Aug 2020 10:06:23 -0700 Subject: [PATCH 12/29] adding azure identity to dev reqs --- sdk/tables/azure-data-tables/dev_requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/tables/azure-data-tables/dev_requirements.txt b/sdk/tables/azure-data-tables/dev_requirements.txt index 5547db3c87f7..75edcaf23693 100644 --- a/sdk/tables/azure-data-tables/dev_requirements.txt +++ b/sdk/tables/azure-data-tables/dev_requirements.txt @@ -1,6 +1,7 @@ -e ../../../tools/azure-devtools -e ../../../tools/azure-sdk-tools ../../core/azure-core +../../identity/azure-identity cryptography>=2.1.4 aiohttp>=3.0; python_version >= '3.5' From 1041fd336e1981dd2b03711ed90b34ecfcaa5c69 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Fri, 28 Aug 2020 10:09:36 -0700 Subject: [PATCH 13/29] adding azure-identity to dev_reqs --- sdk/tables/azure-data-tables/dev_requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/tables/azure-data-tables/dev_requirements.txt b/sdk/tables/azure-data-tables/dev_requirements.txt index 75edcaf23693..f99359672403 100644 --- a/sdk/tables/azure-data-tables/dev_requirements.txt +++ b/sdk/tables/azure-data-tables/dev_requirements.txt @@ -1,7 +1,6 @@ -e ../../../tools/azure-devtools -e ../../../tools/azure-sdk-tools ../../core/azure-core -../../identity/azure-identity cryptography>=2.1.4 aiohttp>=3.0; python_version >= '3.5' - +../../identity/azure-identity From 5af3cc5219a5a8c67f60008cba47ef6fb9302a06 Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Fri, 28 Aug 2020 11:37:56 -0700 Subject: [PATCH 14/29] mirror updates from personal branch --- eng/pipelines/templates/steps/build-test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eng/pipelines/templates/steps/build-test.yml b/eng/pipelines/templates/steps/build-test.yml index 751925a0c603..02879384d83d 100644 --- a/eng/pipelines/templates/steps/build-test.yml +++ b/eng/pipelines/templates/steps/build-test.yml @@ -51,6 +51,10 @@ steps: - ${{ parameters.AfterTestSteps }} + - pwsh: | + Get-ChildItem -path env: + displayName: Dump Env + - task: PublishTestResults@2 condition: always() inputs: From 81d22a79efcfee04ffb1b200bd6954a1ac3c894b Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Fri, 28 Aug 2020 11:41:34 -0700 Subject: [PATCH 15/29] adding continue on error so we can see the env --- eng/pipelines/templates/steps/build-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/pipelines/templates/steps/build-test.yml b/eng/pipelines/templates/steps/build-test.yml index 02879384d83d..45f16a9d6840 100644 --- a/eng/pipelines/templates/steps/build-test.yml +++ b/eng/pipelines/templates/steps/build-test.yml @@ -48,6 +48,7 @@ steps: --injected-packages="${{ parameters.InjectedPackages }}" ${{ parameters.ToxEnvParallel }} env: ${{ parameters.EnvVars }} + continueOnError: true - ${{ parameters.AfterTestSteps }} @@ -55,6 +56,7 @@ steps: Get-ChildItem -path env: displayName: Dump Env + - task: PublishTestResults@2 condition: always() inputs: From 8cff49e94641b4f743714be9bf05ad3fca556257 Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Fri, 28 Aug 2020 11:51:33 -0700 Subject: [PATCH 16/29] update shared test case rg_kwargs resource to mapping instead of NoneType --- sdk/tables/azure-data-tables/tests/_shared/testcase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/tables/azure-data-tables/tests/_shared/testcase.py b/sdk/tables/azure-data-tables/tests/_shared/testcase.py index 7af3476c13d2..19a42cc1e9ec 100644 --- a/sdk/tables/azure-data-tables/tests/_shared/testcase.py +++ b/sdk/tables/azure-data-tables/tests/_shared/testcase.py @@ -352,7 +352,7 @@ def storage_account(): got_storage_info_from_env = existing_storage_name or storage_connection_string storage_name = None - rg_kwargs = None + rg_kwargs = {} try: if i_need_to_create_rg: From 656cabccc4210c72367c68faa8e2d9d4395c18ed Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Fri, 28 Aug 2020 13:50:24 -0700 Subject: [PATCH 17/29] updating dev_reqs --- sdk/tables/azure-data-tables/dev_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/tables/azure-data-tables/dev_requirements.txt b/sdk/tables/azure-data-tables/dev_requirements.txt index f99359672403..44338352a193 100644 --- a/sdk/tables/azure-data-tables/dev_requirements.txt +++ b/sdk/tables/azure-data-tables/dev_requirements.txt @@ -3,4 +3,4 @@ ../../core/azure-core cryptography>=2.1.4 aiohttp>=3.0; python_version >= '3.5' -../../identity/azure-identity +azure-identity \ No newline at end of file From 61e20d8d14672ed52ce59c33f6019625cbad96f8 Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Fri, 28 Aug 2020 14:31:06 -0700 Subject: [PATCH 18/29] random issues gone? --- sdk/tables/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/tables/tests.yml b/sdk/tables/tests.yml index ce8ea8df10dc..4f5aaf6fec1a 100644 --- a/sdk/tables/tests.yml +++ b/sdk/tables/tests.yml @@ -5,6 +5,7 @@ jobs: parameters: BuildTargetingString: azure-data-tables ServiceDirectory: tables + AllocateResourceGroup: 'false' EnvVars: AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) AZURE_SUBSCRIPTION_ID: $(azure-subscription-id) From b3ecea3ab4aa4c995627cc8227bbacff800f2221 Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Fri, 28 Aug 2020 14:38:31 -0700 Subject: [PATCH 19/29] build-test changes --- eng/pipelines/templates/steps/build-test.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/eng/pipelines/templates/steps/build-test.yml b/eng/pipelines/templates/steps/build-test.yml index 45f16a9d6840..751925a0c603 100644 --- a/eng/pipelines/templates/steps/build-test.yml +++ b/eng/pipelines/templates/steps/build-test.yml @@ -48,15 +48,9 @@ steps: --injected-packages="${{ parameters.InjectedPackages }}" ${{ parameters.ToxEnvParallel }} env: ${{ parameters.EnvVars }} - continueOnError: true - ${{ parameters.AfterTestSteps }} - - pwsh: | - Get-ChildItem -path env: - displayName: Dump Env - - - task: PublishTestResults@2 condition: always() inputs: From efb41dafb5d8a2eb274269653fcf5ccf0c04f497 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 31 Aug 2020 16:02:27 -0700 Subject: [PATCH 20/29] undoing all the bot changes from AutorestCI --- sdk/tables/azure-data-tables/MANIFEST.in | 4 +- sdk/tables/azure-data-tables/README.md | 285 +++++++++++++++++- .../azure-data-tables/azure/__init__.py | 2 +- .../azure-data-tables/azure/data/__init__.py | 2 +- sdk/tables/azure-data-tables/setup.py | 18 +- 5 files changed, 290 insertions(+), 21 deletions(-) diff --git a/sdk/tables/azure-data-tables/MANIFEST.in b/sdk/tables/azure-data-tables/MANIFEST.in index 9fd2bc9d0339..c6292d45f925 100644 --- a/sdk/tables/azure-data-tables/MANIFEST.in +++ b/sdk/tables/azure-data-tables/MANIFEST.in @@ -2,4 +2,6 @@ recursive-include tests *.py *.yaml include *.md include azure/__init__.py include azure/data/__init__.py - +include LICENSE.txt +recursive-include tests *.py +recursive-include samples *.py *.md \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/README.md b/sdk/tables/azure-data-tables/README.md index 027137475936..9d5aaa1546f5 100644 --- a/sdk/tables/azure-data-tables/README.md +++ b/sdk/tables/azure-data-tables/README.md @@ -1,21 +1,288 @@ -# Microsoft Azure SDK for Python +# Azure Data Tables client library for Python -This is the Microsoft Azure MyService Management Client Library. -This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. -For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). +Azure Data Tables is a NoSQL data storing service that can be accessed from anywhere in the world via authenticated calls using HTTP or HTTPS. +Tables scale as needed to support the amount of data inserted, and allow for the storing of data with non-complex accessing. +The Azure Data Tables client can be used to access Azure Storage or Cosmos accounts. # Usage +* Storing structured data in the form of tables # Usage +* Quickly querying data using a clustered index +[Source code](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) | [Package (PyPI)](https://pypi.org) | [API reference documentation](https://aka.ms/azsdk/python/tables/docs) | [Product documentation](https://docs.microsoft.com/azure/storage/) | [Samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) For code examples, see [MyService Management](https://docs.microsoft.com/python/api/overview/azure/) on docs.microsoft.com. +## Getting started -# Provide Feedback +### Prerequisites +* Python 2.7, or 3.5 or later is required to use this package. +* You must have an [Azure subscription](https://azure.microsoft.com/free/) and an +[Azure storage account](https://docs.microsoft.com/azure/storage/common/storage-account-overview) to use this package + or you must have a [Azure Cosmos Account](https://docs.microsoft.com/azure/cosmos-db/account-overview). -If you encounter any bugs or have suggestions, please file an issue in the -[Issues](https://github.com/Azure/azure-sdk-for-python/issues) -section of the project. +### Install the package +Install the Azure Data Tables client library for Python with [pip](https://pypi.org/project/pip/): +```bash +pip install --pre azure-data-tables +``` -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-data-tables%2FREADME.png) +### Create a storage account +If you wish to create a new cosmos storage account, you can use the [Azure Cosmos DB](https://docs.microsoft.com/azure/cosmos-db/create-cosmosdb-resources-portal) +If you wish to create a new storage account, you can use the +[Azure Portal](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal), +[Azure PowerShell](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell), +or [Azure CLI](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli): + +```bash +# Create a new resource group to hold the storage account - +# if using an existing resource group, skip this step +az group create --name MyResourceGroup --location westus2 +# Create the storage account +az storage account create -n mystorageaccount -g MyResourceGroup +``` + +### Create the client +The Azure Data Tables client library for Python allows you to interact with two types of resources: the +account and tables, and entities. Interaction with these resources starts with an instance of a [client](#clients). +To create a client object, you will need the account's table service endpoint URL and a credential that allows +you to access the account: + +```python +from azure.data.tables import TableServiceClient +service = TableServiceClient(account_url="https://.table.core.windows.net/", credential=credential) +``` + +#### Looking up the account URL +You can find the account's table service URL using the +[Azure Portal](https://docs.microsoft.com/azure/storage/common/storage-account-overview#storage-account-endpoints), +[Azure PowerShell](https://docs.microsoft.com/powershell/module/az.storage/get-azstorageaccount), +or [Azure CLI](https://docs.microsoft.com/cli/azure/storage/account?view=azure-cli-latest#az-storage-account-show): + +```bash +# Get the table service URL for the account +az storage account show -n mystorageaccount -g MyResourceGroup --query "primaryEndpoints.table" +``` + +#### Types of credentials +The `credential` parameter may be provided in a number of different forms, depending on the type of +[authorization](https://docs.microsoft.com/azure/storage/common/storage-auth) you wish to use: +1. To use a [shared access signature (SAS) token](https://docs.microsoft.com/azure/storage/common/storage-sas-overview), + provide the token as a string. If your account URL includes the SAS token, omit the credential parameter. + You can generate a SAS token from the Azure Portal under "Shared access signature" or use one of the `generate_sas()` + functions to create a sas token for the account or table: + +```python + from datetime import datetime, timedelta + from azure.data.tables import TableServiceClient, generate_account_sas, ResourceTypes, AccountSasPermissions + + sas_token = generate_account_sas( + account_name="", + account_key="", + resource_types=ResourceTypes(service=True), + permission=AccountSasPermissions(read=True), + expiry=datetime.utcnow() + timedelta(hours=1) + ) + + table_service_client = TableServiceClient(account_url="https://.table.core.windows.net", credential=sas_token) +``` + +2. To use an account [shared key](https://docs.microsoft.com/rest/api/storageservices/authenticate-with-shared-key/) + (aka account key or access key), provide the key as a string. This can be found in the Azure Portal under the "Access Keys" + section or by running the following Azure CLI command: + + ```az storage account keys list -g MyResourceGroup -n mystorageaccount``` + Use the key as the credential parameter to authenticate the client: + ```python + from azure.data.tables import TableServiceClient + service = TableServiceClient(account_url="https://.table.core.windows.net", credential="") + ``` + +#### Creating the client from a connection string +Depending on your use case and authorization method, you may prefer to initialize a client instance with a +connection string instead of providing the account URL and credential separately. To do this, pass the +connection string to the client's `from_connection_string` class method: + +```python +from azure.data.tables import TableServiceClient +connection_string = "DefaultEndpointsProtocol=https;AccountName=xxxx;AccountKey=xxxx;EndpointSuffix=core.windows.net" +service = TableServiceClient.from_connection_string(conn_str=connection_string) +``` + +The connection string to your account can be found in the Azure Portal under the "Access Keys" section or by running the following CLI command: + +```bash +az storage account show-connection-string -g MyResourceGroup -n mystorageaccount +``` + +## Key concepts +The following components make up the Azure Data Tables Service: +* The account +* A table within the account, which contains a set of entities +* An entity within a table, as a dictionary + +The Azure Data Tables client library for Python allows you to interact with each of these components through the +use of a dedicated client object. + +### Clients +Two different clients are provided to to interact with the various components of the Table Service: +1. [TableServiceClient](https://aka.ms/azsdk/python/tables/docs) - + this client represents interaction with the Azure account itself, and allows you to acquire preconfigured + client instances to access the tables within. It provides operations to retrieve and configure the account + properties as well as query, create, and delete tables within the account. To perform operations on a specific table, + retrieve a client using the `get_table_client` method. +2. [TableClient](https://aka.ms/azsdk/python/tables/docs) - + this client represents interaction with a specific table (which need not exist yet). It provides operations to + create, delete, or update a table and includes operations to query, get, and upsert entities + within it. + +### Entities +* **Create** - Adds an entity to the table. +* **Delete** - Deletes an entity from the table. +* **Update** - Updates an entities information by either merging or replacing the existing entity. +* **Query** - Queries existing entities in a table based off of the QueryOptions (OData). +* **Get** - Gets a specific entity from a table by partition and row key. +* **Upsert** - Merges or replaces an entity in a table, or if the entity does not exist, inserts the entity. + +## Examples + +The following sections provide several code snippets covering some of the most common Table tasks, including: + +* [Creating a table](#creating-a-table "Creating a table") +* [Creating entities](#creating-entities "Creating entities") +* [Querying entities](#querying-entities "Querying entities") + + +### Creating a table +Create a table in your account + +```python +from azure.data.tables import TableServiceClient +table_service_client = TableServiceClient.from_connection_string(conn_str="") +table_service_client.create_table(table_name="myTable") +``` + +### Creating entities +Create entities in the table + +```python +from azure.data.tables import TableClient +my_entity = {'PartitionKey':'part','RowKey':'row'} +table_client = TableClient.from_connection_string(conn_str="", table_name="myTable") +entity = table_client.create_entity(entity=my_entity) +``` + +### Querying entities +Querying entities in the table + +```python +from azure.data.tables import TableClient +my_filter = "text eq Marker" +table_client = TableClient.from_connection_string(conn_str="", table_name="mytable") +entity = table_client.query_entities(filter=my_filter) +``` + +## Optional Configuration + +Optional keyword arguments can be passed in at the client and per-operation level. The azure-core [reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-core/latest/azure.core.html) describes available configurations for retries, logging, transport protocols, and more. + + +### Retry Policy configuration + +Use the following keyword arguments when instantiating a client to configure the retry policy: + +* __retry_total__ (int): Total number of retries to allow. Takes precedence over other counts. +Pass in `retry_total=0` if you do not want to retry on requests. Defaults to 10. +* __retry_connect__ (int): How many connection-related errors to retry on. Defaults to 3. +* __retry_read__ (int): How many times to retry on read errors. Defaults to 3. +* __retry_status__ (int): How many times to retry on bad status codes. Defaults to 3. +* __retry_to_secondary__ (bool): Whether the request should be retried to secondary, if able. +This should only be enabled of RA-GRS accounts are used and potentially stale data can be handled. +Defaults to `False`. + +### Other client / per-operation configuration + +Other optional configuration keyword arguments that can be specified on the client or per-operation. + +**Client keyword arguments:** + +* __connection_timeout__ (int): Optionally sets the connect and read timeout value, in seconds. +* __transport__ (Any): User-provided transport to send the HTTP request. + +**Per-operation keyword arguments:** + +* __raw_response_hook__ (callable): The given callback uses the response returned from the service. +* __raw_request_hook__ (callable): The given callback uses the request before being sent to service. +* __client_request_id__ (str): Optional user specified identification of the request. +* __user_agent__ (str): Appends the custom value to the user-agent header to be sent with the request. +* __logging_enable__ (bool): Enables logging at the DEBUG level. Defaults to False. Can also be passed in at +the client level to enable it for all requests. +* __headers__ (dict): Pass in custom headers as key, value pairs. E.g. `headers={'CustomValue': value}` + + +## Troubleshooting +### General +Azure Data Tables clients raise exceptions defined in [Azure Core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/README.md). +All Table service operations will throw a `HttpResponseError` on failure with helpful [error codes](https://docs.microsoft.com/rest/api/storageservices/table-service-error-codes). + +### Logging +This library uses the standard +[logging](https://docs.python.org/3/library/logging.html) library for logging. +Basic information about HTTP sessions (URLs, headers, etc.) is logged at INFO +level. + +Detailed DEBUG level logging, including request/response bodies and unredacted +headers, can be enabled on a client with the `logging_enable` argument: +```python +import sys +import logging +from azure.data.tables import TableServiceClient +# Create a logger for the 'azure.data.tables' SDK +logger = logging.getLogger('azure.data.tables') +logger.setLevel(logging.DEBUG) +# Configure a console output +handler = logging.StreamHandler(stream=sys.stdout) +logger.addHandler(handler) +# This client will log detailed information about its HTTP sessions, at DEBUG level +service_client = TableServiceClient.from_connection_string("your_connection_string", logging_enable=True) +``` + +Similarly, `logging_enable` can enable detailed logging for a single operation, +even when it isn't enabled for the client: +```py +service_client.get_service_stats(logging_enable=True) +``` + +## Next steps + +Get started with our [Table samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk). + +Several Azure Data Tables Python SDK samples are available to you in the SDK's GitHub repository. These samples provide example code for additional scenarios commonly encountered while working with Tables: + +* [table_samples_authentication.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) - Examples found in this article: + * From a connection string + * From a shared access key + * From a shared access signature token +* [table_samples_service.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) - Examples found in this article: + * Get and set service properties + * List tables in a account + * Create and delete a table from the service + * Get the TableClient +* [table_samples_client.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) - Examples found in this article: + * Client creation + * Create a table + * Create and Delete entities + * Query entities + * Update entities + * Upsert entities + +### Additional documentation +For more extensive documentation on Azure Data Tables, see the [Azure Data Tables documentation](https://docs.microsoft.com/azure/storage/tables/) on docs.microsoft.com. + +## Contributing +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/azure/__init__.py b/sdk/tables/azure-data-tables/azure/__init__.py index 0260537a02bb..cfb6c283fc83 100644 --- a/sdk/tables/azure-data-tables/azure/__init__.py +++ b/sdk/tables/azure-data-tables/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file +__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/azure/data/__init__.py b/sdk/tables/azure-data-tables/azure/data/__init__.py index 0260537a02bb..cfb6c283fc83 100644 --- a/sdk/tables/azure-data-tables/azure/data/__init__.py +++ b/sdk/tables/azure-data-tables/azure/data/__init__.py @@ -1 +1 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file +__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/setup.py b/sdk/tables/azure-data-tables/setup.py index 1d9274496eb0..724a3be68069 100644 --- a/sdk/tables/azure-data-tables/setup.py +++ b/sdk/tables/azure-data-tables/setup.py @@ -13,7 +13,7 @@ # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-data-tables" -PACKAGE_PPRINT_NAME = "MyService Management" +PACKAGE_PPRINT_NAME = "Azure Data Tables" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') @@ -36,11 +36,8 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py') - if os.path.exists(os.path.join(package_folder_path, 'version.py')) - else os.path.join(package_folder_path, '_version.py'), 'r') as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', - fd.read(), re.MULTILINE).group(1) +with open(os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) # type: ignore if not version: raise RuntimeError('Cannot find version information') @@ -59,7 +56,7 @@ license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com', - url='https://github.com/Azure/azure-sdk-for-python', + url='https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/table/azure-table', classifiers=[ 'Development Status :: 4 - Beta', 'Programming Language :: Python', @@ -80,11 +77,14 @@ 'azure.data', ]), install_requires=[ - 'msrest>=0.5.0', + 'azure-core<2.0.0,>=1.2.2', + 'msrest>=0.6.10', 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], extras_require={ - ":python_version<'3.0'": ['azure-data-nspkg'], + ":python_version<'3.0'": ['futures'], + ":python_version<'3.4'": ['enum34>=1.0.4'], + ":python_version<'3.5'": ["typing"] } ) From 4b39948e62314bf6442565e638f397438b39c0e8 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 31 Aug 2020 16:24:05 -0700 Subject: [PATCH 21/29] edits thanks to Kristas suggestion, hopefully stops AutorestCI from sabotage --- sdk/tables/azure-data-tables/sdk_packaging.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/tables/azure-data-tables/sdk_packaging.toml b/sdk/tables/azure-data-tables/sdk_packaging.toml index 070be4db6470..e8712c1ad41a 100644 --- a/sdk/tables/azure-data-tables/sdk_packaging.toml +++ b/sdk/tables/azure-data-tables/sdk_packaging.toml @@ -6,3 +6,4 @@ package_doc_id = "" is_stable = false is_arm = true need_msrestazure = true +auto_update = false \ No newline at end of file From 356252d15bf6f7935047de01e45c4fc85329b0e6 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 31 Aug 2020 16:35:43 -0700 Subject: [PATCH 22/29] import directly from file, python2 can't find the module --- sdk/tables/azure-data-tables/tests/_shared/testcase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/tables/azure-data-tables/tests/_shared/testcase.py b/sdk/tables/azure-data-tables/tests/_shared/testcase.py index 19a42cc1e9ec..0c49858a2de2 100644 --- a/sdk/tables/azure-data-tables/tests/_shared/testcase.py +++ b/sdk/tables/azure-data-tables/tests/_shared/testcase.py @@ -13,7 +13,7 @@ import time from datetime import datetime, timedelta -from azure.data.tables import ResourceTypes, AccountSasPermissions +from azure.data.tables._models import ResourceTypes, AccountSasPermissions from azure.data.tables._table_shared_access_signature import generate_account_sas try: From dd64612c50eb35d5edd66bf49c3861460e7f7b97 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 31 Aug 2020 16:38:29 -0700 Subject: [PATCH 23/29] pylint fixes --- sdk/tables/azure-data-tables/azure/__init__.py | 2 +- sdk/tables/azure-data-tables/azure/data/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/tables/azure-data-tables/azure/__init__.py b/sdk/tables/azure-data-tables/azure/__init__.py index cfb6c283fc83..6dad646bd993 100644 --- a/sdk/tables/azure-data-tables/azure/__init__.py +++ b/sdk/tables/azure-data-tables/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str \ No newline at end of file +__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str diff --git a/sdk/tables/azure-data-tables/azure/data/__init__.py b/sdk/tables/azure-data-tables/azure/data/__init__.py index cfb6c283fc83..6dad646bd993 100644 --- a/sdk/tables/azure-data-tables/azure/data/__init__.py +++ b/sdk/tables/azure-data-tables/azure/data/__init__.py @@ -1 +1 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str \ No newline at end of file +__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str From 2f6bf8b79d3f43f15edffe5d82981520cfe8cabc Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 31 Aug 2020 17:06:10 -0700 Subject: [PATCH 24/29] debugging why python 2.7 can't find azure data tables --- sdk/tables/azure-data-tables/tests/_shared/testcase.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sdk/tables/azure-data-tables/tests/_shared/testcase.py b/sdk/tables/azure-data-tables/tests/_shared/testcase.py index 0c49858a2de2..e03094554ccc 100644 --- a/sdk/tables/azure-data-tables/tests/_shared/testcase.py +++ b/sdk/tables/azure-data-tables/tests/_shared/testcase.py @@ -13,9 +13,6 @@ import time from datetime import datetime, timedelta -from azure.data.tables._models import ResourceTypes, AccountSasPermissions -from azure.data.tables._table_shared_access_signature import generate_account_sas - try: import unittest.mock as mock except ImportError: @@ -42,7 +39,7 @@ from io import StringIO from azure.core.credentials import AccessToken -#from azure.data.tabless import generate_account_sas, AccountSasPermissions, ResourceTypes +from azure.data.tables import generate_account_sas, AccountSasPermissions, ResourceTypes from azure.mgmt.storage.models import StorageAccount, Endpoints try: From 31685516b6c9359127b8f48013fd5eef760f64ae Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Tue, 1 Sep 2020 12:05:51 -0700 Subject: [PATCH 25/29] undoing last change --- sdk/tables/azure-data-tables/tests/_shared/testcase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/tables/azure-data-tables/tests/_shared/testcase.py b/sdk/tables/azure-data-tables/tests/_shared/testcase.py index e03094554ccc..d20eb80556db 100644 --- a/sdk/tables/azure-data-tables/tests/_shared/testcase.py +++ b/sdk/tables/azure-data-tables/tests/_shared/testcase.py @@ -39,8 +39,8 @@ from io import StringIO from azure.core.credentials import AccessToken -from azure.data.tables import generate_account_sas, AccountSasPermissions, ResourceTypes from azure.mgmt.storage.models import StorageAccount, Endpoints +from azure.data.tables import generate_account_sas, AccountSasPermissions, ResourceTypes try: from devtools_testutils import mgmt_settings_real as settings From 8c9565136451b437e9c61c72c30dbf3c5a941245 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Tue, 1 Sep 2020 12:38:28 -0700 Subject: [PATCH 26/29] reverting setup.py to master branch, adding space in inits just incase --- .../azure-data-tables/azure/__init__.py | 2 +- .../azure-data-tables/azure/data/__init__.py | 2 +- sdk/tables/azure-data-tables/setup.py | 32 ++++++++----------- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/sdk/tables/azure-data-tables/azure/__init__.py b/sdk/tables/azure-data-tables/azure/__init__.py index 6dad646bd993..59cb70146572 100644 --- a/sdk/tables/azure-data-tables/azure/__init__.py +++ b/sdk/tables/azure-data-tables/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str +__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str diff --git a/sdk/tables/azure-data-tables/azure/data/__init__.py b/sdk/tables/azure-data-tables/azure/data/__init__.py index 6dad646bd993..59cb70146572 100644 --- a/sdk/tables/azure-data-tables/azure/data/__init__.py +++ b/sdk/tables/azure-data-tables/azure/data/__init__.py @@ -1 +1 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str +__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str diff --git a/sdk/tables/azure-data-tables/setup.py b/sdk/tables/azure-data-tables/setup.py index 724a3be68069..215511d9ef31 100644 --- a/sdk/tables/azure-data-tables/setup.py +++ b/sdk/tables/azure-data-tables/setup.py @@ -9,7 +9,7 @@ import re import os.path from io import open -from setuptools import find_packages, setup +from setuptools import find_packages, setup # type: ignore # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-data-tables" @@ -25,7 +25,7 @@ try: import azure try: - ver = azure.__version__ + ver = azure.__version__ # type: ignore raise Exception( 'This package is incompatible with azure=={}. '.format(ver) + 'Uninstall it with "pip uninstall azure".' @@ -37,28 +37,24 @@ # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, '_version.py'), 'r') as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) # type: ignore + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', # type: ignore + fd.read(), re.MULTILINE).group(1) if not version: raise RuntimeError('Cannot find version information') -with open('README.md', encoding='utf-8') as f: - readme = f.read() -with open('CHANGELOG.md', encoding='utf-8') as f: - changelog = f.read() - setup( name=PACKAGE_NAME, version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), - long_description=readme + '\n\n' + changelog, + long_description='\n\n', long_description_content_type='text/markdown', license='MIT License', author='Microsoft Corporation', - author_email='azpysdkhelp@microsoft.com', + author_email='ascl@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/table/azure-table', classifiers=[ - 'Development Status :: 4 - Beta', + "Development Status :: 4 - Beta", 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', @@ -71,20 +67,18 @@ ], zip_safe=False, packages=find_packages(exclude=[ - 'tests', # Exclude packages that will be covered by PEP420 or nspkg 'azure', - 'azure.data', + 'tests', ]), install_requires=[ - 'azure-core<2.0.0,>=1.2.2', - 'msrest>=0.6.10', - 'msrestazure>=0.4.32,<2.0.0', - 'azure-common~=1.1', + "azure-core<2.0.0,>=1.2.2", + "msrest>=0.6.10" + # azure-data-tables ], extras_require={ ":python_version<'3.0'": ['futures'], ":python_version<'3.4'": ['enum34>=1.0.4'], ":python_version<'3.5'": ["typing"] - } -) + }, +) \ No newline at end of file From d343b965d2f8a2f035d72d0d4197d3ef65779f0e Mon Sep 17 00:00:00 2001 From: scbedd <45376673+scbedd@users.noreply.github.com> Date: Tue, 1 Sep 2020 12:58:11 -0700 Subject: [PATCH 27/29] add comprehension of nspkg to azure-data-tables --- sdk/tables/azure-data-tables/dev_requirements.txt | 3 ++- sdk/tables/azure-data-tables/sdk_packaging.toml | 7 ------- sdk/tables/azure-data-tables/setup.py | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/sdk/tables/azure-data-tables/dev_requirements.txt b/sdk/tables/azure-data-tables/dev_requirements.txt index 44338352a193..4a940812c683 100644 --- a/sdk/tables/azure-data-tables/dev_requirements.txt +++ b/sdk/tables/azure-data-tables/dev_requirements.txt @@ -3,4 +3,5 @@ ../../core/azure-core cryptography>=2.1.4 aiohttp>=3.0; python_version >= '3.5' -azure-identity \ No newline at end of file +azure-identity +../azure-data-nspkg \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/sdk_packaging.toml b/sdk/tables/azure-data-tables/sdk_packaging.toml index e8712c1ad41a..e7687fdae93b 100644 --- a/sdk/tables/azure-data-tables/sdk_packaging.toml +++ b/sdk/tables/azure-data-tables/sdk_packaging.toml @@ -1,9 +1,2 @@ [packaging] -package_name = "azure-data-tables" -package_nspkg = "azure-data-nspkg" -package_pprint_name = "MyService Management" -package_doc_id = "" -is_stable = false -is_arm = true -need_msrestazure = true auto_update = false \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/setup.py b/sdk/tables/azure-data-tables/setup.py index 215511d9ef31..e449ec31df20 100644 --- a/sdk/tables/azure-data-tables/setup.py +++ b/sdk/tables/azure-data-tables/setup.py @@ -77,7 +77,7 @@ # azure-data-tables ], extras_require={ - ":python_version<'3.0'": ['futures'], + ":python_version<'3.0'": ['futures', 'azure-data-nspkg<2.0.0,>=1.0.0'], ":python_version<'3.4'": ['enum34>=1.0.4'], ":python_version<'3.5'": ["typing"] }, From 8bae8fc7f9b86e9c70f24ec37cef9677a258fd99 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Tue, 1 Sep 2020 13:37:31 -0700 Subject: [PATCH 28/29] adding nspkg to shared_reqs --- sdk/tables/azure-data-tables/setup.py | 1 + shared_requirements.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/sdk/tables/azure-data-tables/setup.py b/sdk/tables/azure-data-tables/setup.py index 215511d9ef31..beade02f584c 100644 --- a/sdk/tables/azure-data-tables/setup.py +++ b/sdk/tables/azure-data-tables/setup.py @@ -70,6 +70,7 @@ # Exclude packages that will be covered by PEP420 or nspkg 'azure', 'tests', + 'azure.data', ]), install_requires=[ "azure-core<2.0.0,>=1.2.2", diff --git a/shared_requirements.txt b/shared_requirements.txt index 9ff3c816582d..a6a995ea1aa4 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -10,6 +10,7 @@ azure-common~=1.1 azure-core<2.0.0,>=1.2.2 azure-cosmosdb-table~=1.0 azure-datalake-store~=0.0.18 +azure-data-nspkg azure-eventhub<6.0.0,>=5.0.0 azure-eventgrid~=1.1 azure-graphrbac~=0.40.0 From 58c8568dcffd1fd0997f798d73455dd6604d91c4 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Tue, 1 Sep 2020 13:54:45 -0700 Subject: [PATCH 29/29] updating shared_req to freeze nspkg at the same version --- shared_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared_requirements.txt b/shared_requirements.txt index a6a995ea1aa4..e8075c11025b 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -10,7 +10,7 @@ azure-common~=1.1 azure-core<2.0.0,>=1.2.2 azure-cosmosdb-table~=1.0 azure-datalake-store~=0.0.18 -azure-data-nspkg +azure-data-nspkg<2.0.0,>=1.0.0 azure-eventhub<6.0.0,>=5.0.0 azure-eventgrid~=1.1 azure-graphrbac~=0.40.0