Skip to content

Commit

Permalink
[Tables] Change to support Python3.7 or above only (#22330)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yalin Li authored Jan 19, 2022
1 parent 956765d commit f30d99d
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 41 deletions.
5 changes: 1 addition & 4 deletions sdk/tables/azure-data-tables/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,20 @@
### Bugs Fixed

### Other Changes
* Python 2.7 and 3.6 are no longer supported. Please use Python version 3.7 or later.

## 12.2.0 (2021-11-10)

**Warning** This release involves a bug fix that may change the behaviour for some users. Partition and Row keys that contain a single quote character (`'`) will now be automatically escaped for upsert, update and delete entity operations. Partition and Row keys that were already escaped, or contained duplicate single quote char (`''`) will now be treated as unescaped values.


### Bugs Fixed

* Resolved bug where strings couldn't be used instead of enum value for entity Update Mode (#20247).
* Resolved bug where single quote characters in Partition and Row keys were not escaped correctly (#20301).

### Features Added

* Added support for async iterators in `aio.TableClient.submit_transaction (#21083, thank you yashbhutoria).

### Other Changes

* Bumped dependency on `msrest` to `>=0.6.21`

## 12.1.0 (2021-07-06)
Expand Down
8 changes: 6 additions & 2 deletions sdk/tables/azure-data-tables/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ Please note, this package is a replacement for [`azure-cosmosdb-tables`](https:/

[Source code][source_code] | [Package (PyPI)][Tables_pypi] | [API reference documentation][Tables_ref_docs] | [Samples][Tables_samples]

## _Disclaimer_

_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_

## Getting started
The Azure Tables SDK can access an Azure Storage or CosmosDB account.

### Prerequisites
* Python 2.7, or 3.6 or later is required to use this package.
* Python 3.7 or later is required to use this package.
* You must have an [Azure subscription][azure_subscription] and either
* an [Azure Storage account][azure_storage_account] or
* an [Azure Cosmos Account][azure_cosmos_account].
Expand Down Expand Up @@ -309,7 +313,7 @@ Get started with our [Table samples][tables_samples].
Several Azure 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.

### Common Scenarios
These code samples show common scenario operations with the Azure Tables client library. The async versions of the samples (the python sample files appended with _async) show asynchronous operations with Tables and require Python 3.5 or later.
These code samples show common scenario operations with the Azure Tables client library. The async versions of the samples (the python sample files appended with _async) show asynchronous operations with Tables and require Python 3.7 or later.

* Create and delete tables: [sample_create_delete_table.py](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/tables/azure-data-tables/samples/sample_create_delete_table.py) ([async version](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/tables/azure-data-tables/samples/async_samples/sample_create_delete_table_async.py))
* List and query tables: [sample_query_tables.py](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/tables/azure-data-tables/samples/sample_query_tables.py) ([async version](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/tables/azure-data-tables/samples/async_samples/sample_query_tables_async.py))
Expand Down
2 changes: 1 addition & 1 deletion sdk/tables/azure-data-tables/dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
-e ../../cosmos/azure-mgmt-cosmosdb
../../core/azure-core
../../nspkg/azure-data-nspkg
aiohttp>=3.0; python_version >= '3.5'
aiohttp>=3.0; python_version >= '3.7'
azure-identity
3 changes: 1 addition & 2 deletions sdk/tables/azure-data-tables/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ urlFragment: tables-samples
# Samples for Azure Tables client library for Python

These code samples show common scenario operations with the Azure Data Tables client library.
The async versions of the samples require Python 3.5 or later.

You can authenticate your client with a Tables API key:
* See [sample_authentication.py][sample_authentication] and [sample_authentication_async.py][sample_authentication_async] for how to authenticate in the above cases.
Expand All @@ -29,7 +28,7 @@ These sample programs show common scenarios for the Tables client's offerings.


### Prerequisites
* Python 2.7, or 3.5 or later is required to use this package.
* Python 3.7 or later is required to use this package.
* You must have an [Azure subscription](https://azure.microsoft.com/free/) and either an
[Azure storage account](https://docs.microsoft.com/azure/storage/common/storage-account-overview) or an [Azure Cosmos Account](https://docs.microsoft.com/azure/cosmos-db/account-overview) to use this package.

Expand Down
2 changes: 0 additions & 2 deletions sdk/tables/azure-data-tables/setup.cfg

This file was deleted.

25 changes: 2 additions & 23 deletions sdk/tables/azure-data-tables/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,6 @@
# a-b-c => a.b.c
namespace_name = PACKAGE_NAME.replace('-', '.')

# azure v0.x is not compatible with this package
# azure v0.x used to have a __version__ attribute (newer versions don't)
try:
import azure
try:
ver = azure.__version__ # type: ignore
raise Exception(
'This package is incompatible with azure=={}. '.format(ver) +
'Uninstall it with "pip uninstall azure".'
)
except AttributeError:
pass
except ImportError:
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
Expand Down Expand Up @@ -62,10 +47,8 @@
classifiers=[
"Development Status :: 5 - Production/Stable",
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
"Programming Language :: Python :: 3 :: Only",
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
Expand All @@ -78,13 +61,9 @@
'tests',
'azure.data',
]),
python_requires=">=3.7",
install_requires=[
"azure-core<2.0.0,>=1.14.0",
"msrest>=0.6.21"
],
extras_require={
":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"]
},
)
7 changes: 0 additions & 7 deletions sdk/tables/azure-data-tables/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,11 @@
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------
import sys

import pytest
from devtools_testutils import add_general_regex_sanitizer, test_proxy

# fixture needs to be visible from conftest

# Ignore async tests for Python < 3.5
collect_ignore_glob = []
if sys.version_info < (3, 5):
collect_ignore_glob.append("*_async.py")

@pytest.fixture(scope="session", autouse=True)
def add_sanitizers(test_proxy):
# sanitizes table/cosmos account names in URLs
Expand Down

0 comments on commit f30d99d

Please sign in to comment.