From 40189723eb57a7c7c1a055101e8fba10ca66043d Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Tue, 13 Apr 2021 16:07:24 -0400 Subject: [PATCH 01/10] adding more typehints --- .../azure/data/tables/_entity.py | 2 +- .../azure/data/tables/_models.py | 54 ++++++++++++++++--- .../azure/data/tables/_policies.py | 23 ++++---- .../azure/data/tables/_table_client.py | 32 +++++------ .../data/tables/_table_service_client.py | 10 ++-- .../data/tables/aio/_table_client_async.py | 10 ++-- .../tables/aio/_table_service_client_async.py | 6 +-- 7 files changed, 87 insertions(+), 50 deletions(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_entity.py b/sdk/tables/azure-data-tables/azure/data/tables/_entity.py index 8d20acf5fefc..5b9049c54a7f 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_entity.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_entity.py @@ -44,7 +44,7 @@ def __getattr__(self, name): :param name:name of entity entry :type name: str :return: TableEntity dictionary - :rtype: dict[str,str] + :rtype: Dict[str,str] """ try: return self[name] diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_models.py b/sdk/tables/azure-data-tables/azure/data/tables/_models.py index 610714084073..7b972cd4af63 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_models.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_models.py @@ -400,12 +400,15 @@ def __init__( self.delete = kwargs.pop("delete", None) or ("d" in _str) def __or__(self, other): + # type: (TableSasPermissions) -> TableSasPermissions return TableSasPermissions(_str=str(self) + str(other)) def __add__(self, other): + # type: (TableSasPermissions) -> TableSasPermissions return TableSasPermissions(_str=str(self) + str(other)) def __str__(self): + # type: () -> TableSasPermissions return ( ("r" if self.read else "") + ("a" if self.add else "") @@ -416,9 +419,10 @@ def __str__(self): @classmethod def from_string( cls, - permission, # type: str + permission, **kwargs ): + # Type: (str, **Dict[str]) -> AccountSasPermissions """Create AccountSasPermissions from a string. To specify read, write, delete, etc. permissions you need only to @@ -541,12 +545,16 @@ def __init__(self, message, response, parts): class BatchErrorException(HttpResponseError): """There is a failure in batch operations. - :param str message: The message of the exception. + :param message: The message of the exception. + :type message: str :param response: Server response to be deserialized. - :param list parts: A list of the parts in multipart response. + :type response: str + :param parts: A list of the parts in multipart response. + :type parts: List[str] """ def __init__(self, message, response, parts, *args, **kwargs): + # type: (str, str, List[str], *List, **Dict) -> None self.parts = parts super(BatchErrorException, self).__init__( message=message, response=response, *args, **kwargs @@ -557,28 +565,57 @@ class BatchTransactionResult(object): """The result of a successful batch operation, can be used by a user to recreate a request in the case of BatchErrorException - :param List[HttpRequest] requests: The requests of the batch - :param List[HttpResponse] results: The HTTP response of each request + :param requests: The requests of the batch + :type requests: List[:class:~azure.core.pipeline.HttpRequest] + :param results: The HTTP response of each request + :type results: List[:class:~azure.core.pipeline.HttpResponse] + :param entities: Entities submitted for the batch + :type entities: List[:class:~azure.data.tables.TableEntity] """ def __init__(self, requests, results, entities): + # type: (List[HttpRequest], List[HttpResponse], List[TableEntity]) -> None self.requests = requests self.results = results self.entities = entities def get_entity(self, row_key): + """Get entity for a given row key + + :param row_key: The row_key correlating to an entity + :type row_key: str + :return: TableEntity or Dictionary submitted + :rtype: Union[Dict[str], TableEntity] + """ + # type: (str) -> Union[TableEntity, Dict[str]] for entity in self.entities: if entity["RowKey"] == row_key: return entity return None def get_request(self, row_key): + """Get request for a given row key + + :param row_key: The row_key correlating to an entity + :type row_key: str + :return: HTTP Request for a row key + :rtype: :class:`~azure.core.pipeline.transport.HttpRequest` + """ + # type: (str) -> HttpRequest for i, entity in enumerate(self.entities): if entity["RowKey"] == row_key: return self.requests[i] return None def get_result(self, row_key): + """Get response for a given row key + + :param row_key: The row_key correlating to an entity + :type row_key: str + :return: HTTP Response for a row key + :rtype: :class:`~azure.core.pipeline.HttpResponse` + """ + # type: (str) -> HttpResponse for i, entity in enumerate(self.entities): if entity["RowKey"] == row_key: return self.results[i] @@ -609,9 +646,8 @@ class ResourceTypes(object): Access to object-level APIs for tables (e.g. Get/Create/Query Entity etc.) """ - def __init__( - self, service=False, object=False - ): # pylint: disable=redefined-builtin + def __init__(self, service=False, object=False): # pylint: disable=redefined-builtin + # type: (bool, bool) -> None self.service = service self.object = object self._str = ("s" if self.service else "") + ("o" if self.object else "") @@ -621,6 +657,7 @@ def __str__(self): @classmethod def from_string(cls, string): + # type: (str) -> ResourceTypes """Create a ResourceTypes from a string. To specify service, container, or object you need only to @@ -696,6 +733,7 @@ def __str__(self): @classmethod def from_string(cls, permission, **kwargs): + # type: (str, Dict[str]) - AccountSasPermissions """Create AccountSasPermissions from a string. To specify read, write, delete, etc. permissions you need only to diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_policies.py b/sdk/tables/azure-data-tables/azure/data/tables/_policies.py index f7de7af5ecdf..a87e3d9f42b9 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_policies.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_policies.py @@ -516,6 +516,7 @@ def __init__( super(TablesRetryPolicy, self).__init__(**kwargs) def get_backoff_time(self, settings): + # type: (Dict) -> Int """ Calculates how long to sleep before retrying. :param dict settings: @@ -523,7 +524,7 @@ def get_backoff_time(self, settings): :return: An integer indicating how long to wait before retrying the request, or None to indicate no retry should be performed. - :rtype: int or None + :rtype: Int """ random_generator = random.Random() backoff = self.initial_backoff + ( @@ -537,15 +538,13 @@ def get_backoff_time(self, settings): random_range_end = backoff + self.random_jitter_range return random_generator.uniform(random_range_start, random_range_end) - def configure_retries( - self, request - ): # pylint: disable=no-self-use, arguments-differ - # type: (...) -> Dict[Any, Any] + def configure_retries(self, request): # pylint: disable=no-self-use, arguments-differ + # type: (HttpRequest) -> Dict[Any, Any] """ :param Any request: :param kwargs: - :return: - :rtype:dict + :return: Retries information + :rtype: Dict[Any, Any] """ body_position = None if hasattr(request.http_request.body, "read"): @@ -572,11 +571,11 @@ def configure_retries( } def sleep(self, settings, transport): # pylint: disable=arguments-differ - # type: (...) -> None + # type: (Any, Any) -> None """ :param Any settings: :param Any transport: - :return:None + :return: None """ backoff = self.get_backoff_time( settings, @@ -586,8 +585,10 @@ def sleep(self, settings, transport): # pylint: disable=arguments-differ transport.sleep(backoff) def send(self, request): + # type: (HttpRequest) -> None """ - :param Any request: + :param request: + :type request: :class:`~azure.core.pipeline.HttpRequest` :return: None """ retries_remaining = True @@ -675,6 +676,7 @@ def __init__( ) def get_backoff_time(self, settings): + # type: (Dict[str]) -> int """ Calculates how long to sleep before retrying. :param dict settings: @@ -731,6 +733,7 @@ def __init__( ) def get_backoff_time(self, settings): + # type: (Dict[str]) -> int """ Calculates how long to sleep before retrying. diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py index 8bcaee5e01f1..6ccccf437fb1 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -158,7 +158,7 @@ def get_table_access_policy( used with Shared Access Signatures. :return: Dictionary of SignedIdentifiers - :rtype: dict[str,AccessPolicy] + :rtype: Dict[str,AccessPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ timeout = kwargs.pop("timeout", None) @@ -211,7 +211,7 @@ def create_table( """Creates a new table under the current account. :return: Dictionary of operation metadata returned from service - :rtype: dict[str,str] + :rtype: Dict[str,str] :raises ~azure.core.exceptions.ResourceExistsError: If the table already exists .. admonition:: Example: @@ -320,9 +320,9 @@ def create_entity( """Insert entity in a table. :param entity: The properties for the table entity. - :type entity: TableEntity or dict[str,str] + :type entity: TableEntity or Dict[str,str] :return: Dictionary mapping operation metadata returned from the service - :rtype: dict[str,str] + :rtype: Dict[str,str] :raises ~azure.core.exceptions.ResourceExistsError: If the entity already exists .. admonition:: Example: @@ -368,7 +368,7 @@ def update_entity( :keyword str etag: Etag of the entity :keyword ~azure.core.MatchConditions match_condition: MatchCondition :return: Dictionary mapping operation metadata returned from the service - :rtype: dict[str,str] + :rtype: Dict[str,str] :raises ~azure.core.exceptions.HttpResponseError: .. admonition:: Example: @@ -560,7 +560,7 @@ def upsert_entity( :param mode: Merge or Replace and Insert on fail :type mode: ~azure.data.tables.UpdateMode :return: Dictionary mapping operation metadata returned from the service - :rtype: dict[str,str] + :rtype: Dict[str,str] :raises ~azure.core.exceptions.HttpResponseError: .. admonition:: Example: @@ -607,14 +607,12 @@ def upsert_entity( except HttpResponseError as error: _process_table_error(error) - def create_batch( - self, **kwargs # type: Dict[str, Any] - ): - # type: (...) -> azure.data.tables.TableBatchOperations + def create_batch(self, **kwargs): + # type: (Dict[str, Any]) -> TableBatchOperations """Create a Batching object from a Table Client :return: Object containing requests and responses - :rtype: ~azure.data.tables.TableBatchOperations + :rtype: :class:`~azure.data.tables.TableBatchOperations` .. admonition:: Example: @@ -636,15 +634,13 @@ def create_batch( **kwargs ) - def send_batch( - self, - batch, # type: azure.data.tables.BatchTransactionResult - **kwargs # type: Any - ): - # type: (...) -> BatchTransactionResult + def send_batch(self, batch, **kwargs): + # type: (TableBatchOperations, Dict[str, Any]) -> BatchTransactionResult """Commit a TableBatchOperations to send requests to the server - :return: Object containing requests and responses + :param batch: Batch of operations + :type batch: :class:`~azure.data.tables.TableBatchOperations` + :return: Object containing requests, responses, and original entities :rtype: ~azure.data.tables.BatchTransactionResult :raises ~azure.data.tables.BatchErrorException: diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py index cf60ecbedb9e..7ad0cbbbe2ae 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py @@ -106,14 +106,14 @@ def from_connection_string( @distributed_trace def get_service_stats(self, **kwargs): - # type: (...) -> dict[str,object] + # type: (Dict[str, Any]) -> TableServiceStats """Retrieves statistics related to replication for the Table service. It is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the account. :keyword callable cls: A custom type or function that will be passed the direct response :return: Dictionary of service stats - :rtype: ~azure.data.tables.models.TableServiceStats - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: :class:`~azure.data.tables.models.TableServiceStats` + :raises :class:`~azure.core.exceptions.HttpResponseError:` """ try: timeout = kwargs.pop("timeout", None) @@ -126,12 +126,12 @@ def get_service_stats(self, **kwargs): @distributed_trace def get_service_properties(self, **kwargs): - # type: (...) -> dict[str,Any] + # type: (...) -> Dict[str, Any] """Gets the properties of an account's Table service, including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules. :return: Dictionary of service properties - :rtype:dict[str, Any] + :rtype: Dict[str, Any] :raises ~azure.core.exceptions.HttpResponseError: """ timeout = kwargs.pop("timeout", None) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py index 5543e2125285..1499ccb8dffb 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py @@ -176,7 +176,7 @@ async def get_table_access_policy( used with Shared Access Signatures. :return: Dictionary of SignedIdentifiers - :rtype: dict[str,~azure.data.tables.AccessPolicy] + :rtype: Dict[str,~azure.data.tables.AccessPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ timeout = kwargs.pop("timeout", None) @@ -233,7 +233,7 @@ async def create_table( """Creates a new table under the given account. :return: Dictionary of operation metadata returned from service - :rtype: dict[str,str] + :rtype: Dict[str,str] :raises ~azure.core.exceptions.ResourceExistsError: If the table already exists .. admonition:: Example: @@ -342,7 +342,7 @@ async def create_entity( :param entity: The properties for the table entity. :type entity: TableEntity or dict[str,str] :return: Dictionary mapping operation metadata returned from the service - :rtype: dict[str,str] + :rtype: Dict[str,str] :raises ~azure.core.exceptions.ResourceExistsError: If the entity already exists .. admonition:: Example: @@ -388,7 +388,7 @@ async def update_entity( :keyword str etag: Etag of the entity :keyword ~azure.core.MatchConditions match_condition: MatchCondition :return: Dictionary of operation metadata returned from service - :rtype: dict[str,str] + :rtype: Dict[str,str] :raises ~azure.core.exceptions.HttpResponseError: .. admonition:: Example: @@ -579,7 +579,7 @@ async def upsert_entity( :param mode: Merge or Replace and Insert on fail :type mode: ~azure.data.tables.UpdateMode :return: Dictionary mapping operation metadata returned from the service - :rtype: dict[str,str] + :rtype: Dict[str,str] :raises ~azure.core.exceptions.HttpResponseError: .. admonition:: Example: diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py index 3adebc7f14f9..2e5e2e941d72 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py @@ -383,12 +383,12 @@ def get_table_client( The table need not already exist. - :param table: + :param table_name: The queue. This can either be the name of the queue, or an instance of QueueProperties. - :type table: str or ~azure.storage.table.TableProperties + :type table_name: str or ~azure.storage.table.TableProperties :returns: A :class:`~azure.data.tables.TableClient` object. - :rtype: ~azure.data.tables.TableClient + :rtype: :class:`~azure.data.tables.TableClient` """ _pipeline = AsyncPipeline( From 87747246695a458f0801836e6fd022e227f0a73d Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Wed, 14 Apr 2021 08:26:43 -0400 Subject: [PATCH 02/10] small updates --- .../azure/data/tables/_models.py | 16 ++++++++-------- .../azure/data/tables/_policies.py | 13 ++++++++----- .../azure/data/tables/aio/_policies_async.py | 4 ++++ sdk/tables/azure-data-tables/samples/README.md | 2 +- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_models.py b/sdk/tables/azure-data-tables/azure/data/tables/_models.py index 7b972cd4af63..f02229f0d10c 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_models.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_models.py @@ -554,7 +554,7 @@ class BatchErrorException(HttpResponseError): """ def __init__(self, message, response, parts, *args, **kwargs): - # type: (str, str, List[str], *List, **Dict) -> None + # type: (str, str, List[str], List[str], Dict[str, Any]) -> None self.parts = parts super(BatchErrorException, self).__init__( message=message, response=response, *args, **kwargs @@ -580,6 +580,7 @@ def __init__(self, requests, results, entities): self.entities = entities def get_entity(self, row_key): + # type: (str) -> Union[Dict[str], TableEntity] """Get entity for a given row key :param row_key: The row_key correlating to an entity @@ -587,13 +588,13 @@ def get_entity(self, row_key): :return: TableEntity or Dictionary submitted :rtype: Union[Dict[str], TableEntity] """ - # type: (str) -> Union[TableEntity, Dict[str]] for entity in self.entities: if entity["RowKey"] == row_key: return entity return None def get_request(self, row_key): + # type: (str) -> HttpRequest """Get request for a given row key :param row_key: The row_key correlating to an entity @@ -601,13 +602,13 @@ def get_request(self, row_key): :return: HTTP Request for a row key :rtype: :class:`~azure.core.pipeline.transport.HttpRequest` """ - # type: (str) -> HttpRequest for i, entity in enumerate(self.entities): if entity["RowKey"] == row_key: return self.requests[i] return None def get_result(self, row_key): + # type: (str) -> HttpResponse """Get response for a given row key :param row_key: The row_key correlating to an entity @@ -615,7 +616,6 @@ def get_result(self, row_key): :return: HTTP Response for a row key :rtype: :class:`~azure.core.pipeline.HttpResponse` """ - # type: (str) -> HttpResponse for i, entity in enumerate(self.entities): if entity["RowKey"] == row_key: return self.results[i] @@ -733,18 +733,18 @@ def __str__(self): @classmethod def from_string(cls, permission, **kwargs): - # type: (str, Dict[str]) - AccountSasPermissions + # type: (str, Dict[str]) -> AccountSasPermissions """Create AccountSasPermissions from a string. To specify read, write, delete, etc. permissions you need only to include the first letter of the word in the string. E.g. for read and write permissions you would provide a string "rw". - :param str permission: Specify permissions in - the string with the first letter of the word. + :param permission: Specify permissions in the string with the first letter of the word. + :type permission: str :keyword callable cls: A custom type or function that will be passed the direct response :return: A AccountSasPermissions object - :rtype: ~azure.data.tables.AccountSasPermissions + :rtype: :class:`~azure.data.tables.AccountSasPermissions` """ p_read = "r" in permission p_write = "w" in permission diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_policies.py b/sdk/tables/azure-data-tables/azure/data/tables/_policies.py index a87e3d9f42b9..751bd163130f 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_policies.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_policies.py @@ -516,10 +516,11 @@ def __init__( super(TablesRetryPolicy, self).__init__(**kwargs) def get_backoff_time(self, settings): - # type: (Dict) -> Int + # type: (Dict[str, Any]) -> Int """ Calculates how long to sleep before retrying. - :param dict settings: + :param settings: + :type settings: Dict[str, Any] :keyword callable cls: A custom type or function that will be passed the direct response :return: An integer indicating how long to wait before retrying the request, @@ -542,7 +543,7 @@ def configure_retries(self, request): # pylint: disable=no-self-use, arguments- # type: (HttpRequest) -> Dict[Any, Any] """ :param Any request: - :param kwargs: + :type request: :class:`~azure.core.pipeline.transport.HttpRequest` :return: Retries information :rtype: Dict[Any, Any] """ @@ -679,7 +680,8 @@ def get_backoff_time(self, settings): # type: (Dict[str]) -> int """ Calculates how long to sleep before retrying. - :param dict settings: + :param settings: + :type settings: Dict[str, Any] :keyword callable cls: A custom type or function that will be passed the direct response :return: An integer indicating how long to wait before retrying the request, @@ -737,7 +739,8 @@ def get_backoff_time(self, settings): """ Calculates how long to sleep before retrying. - :param dict settings: + :param settings: + :type settings: Dict[str, Any] :keyword callable cls: A custom type or function that will be passed the direct response :return: An integer indicating how long to wait before retrying the request, diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_policies_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_policies_async.py index 89ff936c4539..83a494109189 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_policies_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_policies_async.py @@ -135,6 +135,8 @@ def get_backoff_time(self, settings): """ Calculates how long to sleep before retrying. + :param settings: + :type settings: Dict[str, Any] :return: An integer indicating how long to wait before retrying the request, or None to indicate no retry should be performed. @@ -247,6 +249,8 @@ def get_backoff_time(self, settings): """ Calculates how long to sleep before retrying. + :param settings: + :type settings: Dict[str, Any] :return: An integer indicating how long to wait before retrying the request, or None to indicate no retry should be performed. diff --git a/sdk/tables/azure-data-tables/samples/README.md b/sdk/tables/azure-data-tables/samples/README.md index e8fe15e7735f..0349aecf4352 100644 --- a/sdk/tables/azure-data-tables/samples/README.md +++ b/sdk/tables/azure-data-tables/samples/README.md @@ -55,7 +55,7 @@ pip install --pre azure-data-tables |------------|------------------| |`Equal`|`eq`| |`GreaterThan`|`gt`| -|`GreaterTahnOrEqual`|`ge`| +|`GreaterThanOrEqual`|`ge`| |`LessThan`|`lt`| |`LessThanOrEqual`|`le`| |`NotEqual`|`ne`| From 408d3e0d4c87bb37d31c6c015ba646c479154239 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 19 Apr 2021 12:02:20 -0400 Subject: [PATCH 03/10] sphinx and apiview updates --- .../azure/data/tables/_models.py | 16 ++-- .../azure/data/tables/_policies.py | 2 +- .../azure/data/tables/_serialize.py | 2 +- .../azure/data/tables/_table_batch.py | 18 ++--- .../azure/data/tables/_table_client.py | 80 +++++++++---------- .../data/tables/_table_service_client.py | 65 +++++++-------- .../tables/_table_shared_access_signature.py | 4 +- .../data/tables/aio/_table_batch_async.py | 28 ++----- .../data/tables/aio/_table_client_async.py | 80 ++++++++++--------- .../tables/aio/_table_service_client_async.py | 76 ++++++++---------- 10 files changed, 171 insertions(+), 200 deletions(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_models.py b/sdk/tables/azure-data-tables/azure/data/tables/_models.py index f02229f0d10c..f7fae37f5a43 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_models.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_models.py @@ -432,8 +432,8 @@ def from_string( :param str permission: Specify permissions in the string with the first letter of the word. :keyword callable cls: A custom type or function that will be passed the direct response - :return: A AccountSasPermissions object - :rtype: ~azure.data.tables.AccountSasPermissions + :return: An AccountSasPermissions object + :rtype: :class:`~azure.data.tables.AccountSasPermissions` """ p_read = "r" in permission p_add = "a" in permission @@ -551,6 +551,8 @@ class BatchErrorException(HttpResponseError): :type response: str :param parts: A list of the parts in multipart response. :type parts: List[str] + :param args: Args to be passed to :class:`~azure.core.exceptions.HttpResponseError` + :type args: List[str] """ def __init__(self, message, response, parts, *args, **kwargs): @@ -566,11 +568,11 @@ class BatchTransactionResult(object): recreate a request in the case of BatchErrorException :param requests: The requests of the batch - :type requests: List[:class:~azure.core.pipeline.HttpRequest] + :type requests: List[~azure.core.pipeline.HttpRequest] :param results: The HTTP response of each request - :type results: List[:class:~azure.core.pipeline.HttpResponse] + :type results: List[~azure.core.pipeline.HttpResponse] :param entities: Entities submitted for the batch - :type entities: List[:class:~azure.data.tables.TableEntity] + :type entities: List[~azure.data.tables.TableEntity] """ def __init__(self, requests, results, entities): @@ -667,7 +669,7 @@ def from_string(cls, string): :param str string: Specify service, container, or object in in the string with the first letter of the word. :return: A ResourceTypes object - :rtype: ~azure.data.tables.ResourceTypes + :rtype: :class:`~azure.data.tables.ResourceTypes` """ res_service = "s" in string res_object = "o" in string @@ -743,7 +745,7 @@ def from_string(cls, permission, **kwargs): :param permission: Specify permissions in the string with the first letter of the word. :type permission: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: A AccountSasPermissions object + :return: An AccountSasPermissions object :rtype: :class:`~azure.data.tables.AccountSasPermissions` """ p_read = "r" in permission diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_policies.py b/sdk/tables/azure-data-tables/azure/data/tables/_policies.py index 2fc780e731a0..e0623c4f5d96 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_policies.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_policies.py @@ -184,7 +184,7 @@ def send(self, request): :param request: The PipelineRequest object :type request: ~azure.core.pipeline.PipelineRequest :return: Returns the PipelineResponse or raises error if maximum retries exceeded. - :rtype: ~azure.core.pipeline.PipelineResponse + :rtype: :class:`~azure.core.pipeline.PipelineResponse` :raises: ~azure.core.exceptions.AzureError if maximum retries exceeded. :raises: ~azure.core.exceptions.ClientAuthenticationError if authentication """ diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_serialize.py b/sdk/tables/azure-data-tables/azure/data/tables/_serialize.py index 58a51eb291ca..22a26d681347 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_serialize.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_serialize.py @@ -56,7 +56,7 @@ def _parameter_filter_substitution(parameters, query_filter): # type: (Dict[str, str], str) -> str """Replace user defined parameter in filter :param parameters: User defined parameters - :param filter: Filter for querying + :param str query_filter: Filter for querying """ if parameters: filter_strings = query_filter.split(' ') diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_batch.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_batch.py index 1d54a38f0b7c..42cc0c61bc98 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_batch.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_batch.py @@ -208,9 +208,10 @@ def update_entity( :param entity: The properties for the table entity. :type entity: TableEntity or dict[str,str] :param mode: Merge or Replace entity - :type mode: ~azure.data.tables.UpdateMode + :type mode: :class:`~azure.data.tables.UpdateMode` :keyword str etag: Etag of the entity - :keyword ~azure.core.MatchConditions match_condition: MatchCondition + :keyword match_condition: MatchCondition + :paramtype match_condition: :class:`~azure.core.MatchConditions` :return: None :raises ValueError: @@ -294,8 +295,6 @@ def _batch_update_entity( :param query_options: Parameter group. :type query_options: ~azure.data.tables.models.QueryOptions :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: """ _format = None @@ -402,8 +401,6 @@ def _batch_merge_entity( :param query_options: Parameter group. :type query_options: ~azure.data.tables.models.QueryOptions :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: """ _format = None @@ -490,7 +487,8 @@ def delete_entity( :param row_key: The row key of the entity. :type row_key: str :keyword str etag: Etag of the entity - :keyword ~azure.core.MatchConditions match_condition: MatchCondition + :keyword match_condition: MatchCondition + :paramtype match_condition: :class:`~azure.core.MatchConditions` :raises ValueError: .. admonition:: Example: @@ -560,8 +558,6 @@ def _batch_delete_entity( :param query_options: Parameter group. :type query_options: ~azure.data.tables.models.QueryOptions :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: """ _format = None @@ -632,8 +628,8 @@ def upsert_entity( :param entity: The properties for the table entity. :type entity: TableEntity or dict[str,str] - :param mode: Merge or Replace and Insert on fail - :type mode: ~azure.data.tables.UpdateMode + :param mode: Merge or Replace entity + :type mode: :class:`~azure.data.tables.UpdateMode` :raises ValueError: .. admonition:: Example: diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py index 18185575b91d..543189ba8a41 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -91,7 +91,7 @@ def from_connection_string( :param table_name: The table name. :type table_name: str :returns: A table client. - :rtype: ~azure.data.tables.TableClient + :rtype: :class:`~azure.data.tables.TableClient` .. admonition:: Example: @@ -112,15 +112,14 @@ def from_table_url(cls, table_url, credential=None, **kwargs): # type: (str, Optional[Any], Any) -> TableClient """A client to interact with a specific Table. - :param table_url: The full URI to the table, including SAS token if used. - :type table_url: str + :param str table_url: The full URI to the table, including SAS token if used. :param credential: The credentials with which to authenticate. This is optional if the account URL already has a SAS token. The value can be a SAS token string, an account shared access key. :type credential: str :returns: A table client. - :rtype: ~azure.data.tables.TableClient + :rtype: :class:`~azure.data.tables.TableClient` """ try: if not table_url.lower().startswith("http"): @@ -158,8 +157,8 @@ def get_table_access_policy( used with Shared Access Signatures. :return: Dictionary of SignedIdentifiers - :rtype: Dict[str,AccessPolicy] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: Dict[str, :class:`~azure.data.tables.AccessPolicy`] + :raises: :class:`~azure.core.exceptions.HttpResponseError` """ timeout = kwargs.pop("timeout", None) try: @@ -182,11 +181,10 @@ def set_table_access_policy( # type: (...) -> None """Sets stored access policies for the table that may be used with Shared Access Signatures. - :param signed_identifiers: - :type signed_identifiers: dict[str,AccessPolicy] + :param signed_identifiers: Access policies to set for the table + :type signed_identifiers: Dict[str, :class:`~azure.data.tables.AccessPolicy`] :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: + :raises: :class:`~azure.core.exceptions.HttpResponseError` """ identifiers = [] for key, value in signed_identifiers.items(): @@ -220,7 +218,7 @@ def create_table( :return: Dictionary of operation metadata returned from service :rtype: Dict[str,str] - :raises ~azure.core.exceptions.ResourceExistsError: If the table already exists + :raises: :class:`~azure.core.exceptions.ResourceExistsError` If the entity already exists .. admonition:: Example: @@ -250,8 +248,7 @@ def delete_table( """Deletes the table under the current account. :return: None - :rtype: None - :raises ~azure.core.exceptions.ResourceNotFoundError: If the table does not exist + :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` If the table does not exist .. admonition:: Example: @@ -282,10 +279,10 @@ def delete_entity( :param row_key: The row key of the entity. :type row_key: str :keyword str etag: Etag of the entity - :keyword ~azure.core.MatchConditions match_condition: MatchCondition + :keyword match_condition: MatchCondition + :paramtype match_condition: :class:`~azure.core.MatchConditions` :return: None - :rtype: None - :raises ~azure.core.exceptions.ResourceNotFoundError: If the entity does not exist + :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` If the entity already does not exist .. admonition:: Example: @@ -328,10 +325,10 @@ def create_entity( """Insert entity in a table. :param entity: The properties for the table entity. - :type entity: TableEntity or Dict[str,str] + :type entity: :class:`~azure.data.tables.TableEntity` or Dict[str,str] :return: Dictionary mapping operation metadata returned from the service :rtype: Dict[str,str] - :raises ~azure.core.exceptions.ResourceExistsError: If the entity already exists + :raises: :class:`~azure.core.exceptions.ResourceExistsError` If the entity already exists .. admonition:: Example: @@ -368,16 +365,17 @@ def update_entity( """Update entity in a table. :param entity: The properties for the table entity. - :type entity: TableEntity or dict[str,str] + :type entity: :class:`~azure.data.tables.TableEntity` or Dict[str,str] :param mode: Merge or Replace entity - :type mode: ~azure.data.tables.UpdateMode + :type mode: :class:`~azure.data.tables.UpdateMode` :keyword str partition_key: The partition key of the entity. :keyword str row_key: The row key of the entity. :keyword str etag: Etag of the entity - :keyword ~azure.core.MatchConditions match_condition: MatchCondition + :keyword match_condition: MatchCondition + :paramtype match_condition: :class:`~azure.core.MatchConditions` :return: Dictionary mapping operation metadata returned from the service :rtype: Dict[str,str] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: :class:`~azure.core.exceptions.HttpResponseError` .. admonition:: Example: @@ -439,10 +437,10 @@ def list_entities( :keyword int results_per_page: Number of entities per page in return ItemPaged :keyword select: Specify desired properties of an entity to return certain entities - :paramtype select: str or list[str] - :return: Query of table entities - :rtype: ~azure.core.paging.ItemPaged[~azure.data.tables.TableEntity] - :raises ~azure.core.exceptions.HttpResponseError: + :paramtype select: str or List[str] + :return: ItemPaged[:class:`~azure.data.tables.TableEntity`] + :rtype: ~azure.core.paging.ItemPaged + :raises: :class:`~azure.core.exceptions.HttpResponseError` .. admonition:: Example: @@ -473,17 +471,17 @@ def query_entities( query_filter, **kwargs ): - # type: (...) -> ItemPaged[TableEntity] + # type: (str, **Dict[str, Any]) -> ItemPaged[TableEntity] """Lists entities in a table. - :param str filter: Specify a filter to return certain entities + :param str query_filter: Specify a filter to return certain entities :keyword int results_per_page: Number of entities per page in return ItemPaged :keyword select: Specify desired properties of an entity to return certain entities - :paramtype select: str or list[str] - :keyword dict parameters: Dictionary for formatting query with additional, user defined parameters - :return: Query of table entities - :rtype: ~azure.core.paging.ItemPaged[~azure.data.tables.TableEntity] - :raises ~azure.core.exceptions.HttpResponseError: + :paramtype select: str or List[str] + :keyword Dict[str, Any] parameters: Dictionary for formatting query with additional, user defined parameters + :return: ItemPaged[:class:`~azure.data.tables.TableEntity`] + :rtype: ~azure.core.paging.ItemPaged + :raises: :class:`~azure.core.exceptions.HttpResponseError` .. admonition:: Example: @@ -528,8 +526,8 @@ def get_entity( :param row_key: The row key of the entity. :type row_key: str :return: Dictionary mapping operation metadata returned from the service - :rtype: ~azure.data.tables.TableEntity - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: :class:`~azure.data.tables.TableEntity` + :raises: :class:`~azure.core.exceptions.HttpResponseError` .. admonition:: Example: @@ -564,12 +562,12 @@ def upsert_entity( """Update/Merge or Insert entity into table. :param entity: The properties for the table entity. - :type entity: TableEntity or dict[str,str] - :param mode: Merge or Replace and Insert on fail - :type mode: ~azure.data.tables.UpdateMode + :type entity: :class:`~azure.data.tables.TableEntity` or Dict[str,str] + :param mode: Merge or Replace entity + :type mode: :class:`~azure.data.tables.UpdateMode` :return: Dictionary mapping operation metadata returned from the service :rtype: Dict[str,str] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: :class:`~azure.core.exceptions.HttpResponseError` .. admonition:: Example: @@ -649,8 +647,8 @@ def send_batch(self, batch, **kwargs): :param batch: Batch of operations :type batch: :class:`~azure.data.tables.TableBatchOperations` :return: Object containing requests, responses, and original entities - :rtype: ~azure.data.tables.BatchTransactionResult - :raises ~azure.data.tables.BatchErrorException: + :rtype: :class:`~azure.data.tables.BatchTransactionResult` + :raises: :class:`~azure.data.tables.BatchErrorException` .. admonition:: Example: diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py index 9afd7e1c9d86..048da686e170 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py @@ -70,11 +70,9 @@ def from_connection_string( ): # type: (...) -> TableServiceClient """Create TableServiceClient from a connection string. - :param conn_str: - A connection string to an Azure Storage or Cosmos account. - :type conn_str: str + :param str conn_str: A connection string to an Azure Storage or Cosmos account. :returns: A Table service client. - :rtype: ~azure.data.tables.TableServiceClient + :rtype: :class:`~azure.data.tables.TableServiceClient` .. admonition:: Example: @@ -99,7 +97,7 @@ def get_service_stats(self, **kwargs): :keyword callable cls: A custom type or function that will be passed the direct response :return: Dictionary of service stats :rtype: :class:`~azure.data.tables.models.TableServiceStats` - :raises :class:`~azure.core.exceptions.HttpResponseError:` + :raises: :class:`~azure.core.exceptions.HttpResponseError:` """ try: timeout = kwargs.pop("timeout", None) @@ -117,8 +115,8 @@ def get_service_properties(self, **kwargs): including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules. :return: Dictionary of service properties - :rtype: Dict[str, Any] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: :class:`~azure.data.tables.models.TableServiceProperties` + :raises: :class:`~azure.core.exceptions.HttpResponseError` """ timeout = kwargs.pop("timeout", None) try: @@ -141,16 +139,15 @@ def set_service_properties( including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules. :param analytics_logging: Properties for analytics - :type analytics_logging: ~azure.data.tables.TableAnalyticsLogging + :type analytics_logging: :class:`~azure.data.tables.TableAnalyticsLogging` :param hour_metrics: Hour level metrics - :type hour_metrics: ~azure.data.tables.Metrics + :type hour_metrics: :class:`~azure.data.tables.Metrics` :param minute_metrics: Minute level metrics - :type minute_metrics: ~azure.data.tables.Metrics + :type minute_metrics: :class:`~azure.data.tables.Metrics` :param cors: Cross-origin resource sharing rules - :type cors: ~azure.data.tables.CorsRule + :type cors: :class:`~azure.data.tables.CorsRule` :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: + :raises: :class:`~azure.core.exceptions.HttpResponseError` """ props = TableServiceProperties( logging=analytics_logging, @@ -175,8 +172,8 @@ def create_table( :param table_name: The Table name. :type table_name: str :return: TableClient - :rtype: ~azure.data.tables.TableClient - :raises ~azure.core.exceptions.ResourceExistsError: + :rtype: :class:`~azure.data.tables.TableClient` + :raises: :class:`~azure.core.exceptions.ResourceExistsError` .. admonition:: Example: @@ -205,8 +202,8 @@ def create_table_if_not_exists( :param table_name: The Table name. :type table_name: str :return: TableClient - :rtype: ~azure.data.tables.TableClient - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: :class:`~azure.data.tables.TableClient` + :raises: :class:`~azure.core.exceptions.HttpResponseError` .. admonition:: Example: @@ -236,8 +233,7 @@ def delete_table( :param table_name: The Table name. :type table_name: str :return: None - :rtype: None - :raises ~azure.core.exceptions.ResourceNotFoundError: + :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` .. admonition:: Example: @@ -255,20 +251,19 @@ def delete_table( def query_tables( self, query_filter, - **kwargs # type: Any + **kwargs ): - # type: (...) -> ItemPaged[TableItem] + # type: (str, **Dict[str, Any]) -> ItemPaged[TableItem] """Queries tables under the given account. - :param filter: Specify a filter to return certain tables. - :type filter: str + :param str query_filter: Specify a filter to return certain tables. :keyword int results_per_page: Number of tables per page in return ItemPaged :keyword select: Specify desired properties of a table to return certain tables - :paramtype select: str or list[str] - :keyword dict[str,str] parameters: Dictionary for formatting query with additional, user defined parameters - :return: An ItemPaged of tables - :rtype: ~azure.core.paging.ItemPaged[TableItem] - :raises ~azure.core.exceptions.HttpResponseError: + :paramtype select: str or List[str] + :keyword Dict[str, str] parameters: Dictionary for formatting query with additional, user defined parameters + :return: ItemPaged[:class:`~azure.data.tables.TableItem`] + :rtype: ~azure.core.paging.ItemPaged + :raises: :class:`~azure.core.exceptions.HttpResponseError` .. admonition:: Example: @@ -306,10 +301,10 @@ def list_tables( :keyword int results_per_page: Number of tables per page in return ItemPaged :keyword select: Specify desired properties of a table to return certain tables - :paramtype select: str or list[str] - :return: A query of tables - :rtype: ~azure.core.paging.ItemPaged[TableItem] - :raises ~azure.core.exceptions.HttpResponseError: + :paramtype select: str or List[str] + :return: ItemPaged[:class:`~azure.data.tables.TableItem`] + :rtype: ~azure.core.paging.ItemPaged + :raises: :class:`~azure.core.exceptions.HttpResponseError` .. admonition:: Example: @@ -339,11 +334,9 @@ def get_table_client(self, table_name, **kwargs): The table need not already exist. - :param table_name: - The table name - :type table_name: str + :param str table_name: The table name :returns: A :class:`~azure.data.tables.TableClient` object. - :rtype: ~azure.data.tables.TableClient + :rtype: :class:`~azure.data.tables.TableClient` """ pipeline = Pipeline( diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_shared_access_signature.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_shared_access_signature.py index 42c1e607c07f..f8d1306fa053 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_shared_access_signature.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_shared_access_signature.py @@ -30,9 +30,9 @@ def generate_account_sas( Use the returned signature with the sas_token parameter of TableService. :param account_name: Account name - :type account_name:str + :type account_name: str :param account_key: Account key - :type account_key:str + :type account_key: str :param resource_types: Specifies the resource types that are accessible with the account SAS. :type resource_types: ResourceTypes diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_batch_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_batch_async.py index 3c9f869713c8..6639dadc0002 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_batch_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_batch_async.py @@ -195,11 +195,12 @@ def update_entity( """Adds an update operation to the current batch. :param entity: The properties for the table entity. - :type entity: TableEntity or dict[str,str] + :type entity: TableEntity or Dict[str,str] :param mode: Merge or Replace entity - :type mode: ~azure.data.tables.UpdateMode + :type mode: :class:`~azure.data.tables.UpdateMode` :keyword str etag: Etag of the entity - :keyword ~azure.core.MatchConditions match_condition: MatchCondition + :keyword match_condition: MatchCondition + :paramtype match_condition: :class:`~azure.core.MatchConditions` :return: None :raises ValueError: @@ -281,10 +282,6 @@ def _batch_update_entity( :type table_entity_properties: dict[str, object] :param query_options: Parameter group. :type query_options: ~azure.data.tables.models.QueryOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: """ _format = None @@ -389,10 +386,6 @@ def _batch_merge_entity( :type table_entity_properties: dict[str, object] :param query_options: Parameter group. :type query_options: ~azure.data.tables.models.QueryOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: """ _format = None @@ -479,9 +472,8 @@ def delete_entity( :param row_key: The row key of the entity. :type row_key: str :keyword str etag: Etag of the entity - :keyword ~azure.core.MatchConditions match_condition: MatchCondition - :return: None - :raises ValueError: + :keyword match_condition: MatchCondition + :paramtype match_condition: :class:`~azure.core.MatchConditions` .. admonition:: Example: @@ -548,10 +540,6 @@ def _batch_delete_entity( :type request_id_parameter: str :param query_options: Parameter group. :type query_options: ~azure.data.tables.models.QueryOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: """ _format = None @@ -622,8 +610,8 @@ def upsert_entity( :param entity: The properties for the table entity. :type entity: TableEntity or dict[str,str] - :param mode: Merge or Replace and Insert on fail - :type mode: ~azure.data.tables.UpdateMode + :param mode: Merge or Replace entity + :type mode: :class:`~azure.data.tables.UpdateMode` :return: None :raises ValueError: diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py index b2a92f45e2e1..c0d3c8b50a60 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py @@ -91,7 +91,7 @@ def from_connection_string( :param table_name: The table name. :type table_name: str :returns: A table client. - :rtype: ~azure.data.tables.TableClient + :rtype: :class:`~azure.data.tables.TableClient` .. admonition:: Example: @@ -120,7 +120,7 @@ def from_table_url(cls, table_url, credential=None, **kwargs): shared access key. :type credential: str :returns: A table client. - :rtype: ~azure.data.tables.TableClient + :rtype: :class:`~azure.data.tables.TableClient` """ try: if not table_url.lower().startswith("http"): @@ -159,8 +159,8 @@ async def get_table_access_policy( used with Shared Access Signatures. :return: Dictionary of SignedIdentifiers - :rtype: Dict[str,~azure.data.tables.AccessPolicy] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: Dict[str, :class:`~azure.data.tables.AccessPolicy`] + :raises: :class:`~azure.core.exceptions.HttpResponseError` """ timeout = kwargs.pop("timeout", None) try: @@ -187,11 +187,10 @@ async def set_table_access_policy( # type: (...) -> None """Sets stored access policies for the table that may be used with Shared Access Signatures. - :param signed_identifiers: - :type signed_identifiers: dict[str,AccessPolicy] + :param signed_identifiers: Access policies to set for the table + :type signed_identifiers: Dict[str, :class:`~azure.data.tables.AccessPolicy`] :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: + :raises: :class:`~azure.core.exceptions.HttpResponseError` """ identifiers = [] for key, value in signed_identifiers.items(): @@ -225,7 +224,7 @@ async def create_table( :return: Dictionary of operation metadata returned from service :rtype: Dict[str,str] - :raises ~azure.core.exceptions.ResourceExistsError: If the table already exists + :raises: :class:`~azure.core.exceptions.ResourceExistsError` If the entity already exists .. admonition:: Example: @@ -255,8 +254,7 @@ async def delete_table( """Deletes the table under the current account. :return: None - :rtype: None - :raises ~azure.core.exceptions.ResourceNotFoundError: + :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` If the table does not exist .. admonition:: Example: @@ -287,10 +285,10 @@ async def delete_entity( :param row_key: The row key of the entity. :type row_key: str :keyword str etag: Etag of the entity - :keyword ~azure.core.MatchConditions match_condition: MatchCondition + :keyword match_condition: MatchCondition + :paramtype match_condition: :class:`~azure.core.MatchConditions` :return: None - :rtype: None - :raises ~azure.core.exceptions.ResourceNotFoundError: If the table does not exist + :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` If the entity already does not exist .. admonition:: Example: @@ -331,10 +329,11 @@ async def create_entity( """Insert entity in a table. :param entity: The properties for the table entity. - :type entity: TableEntity or dict[str,str] + :type entity: :class:`~azure.data.tables.TableEntity` or Dict[str,str] :return: Dictionary mapping operation metadata returned from the service :rtype: Dict[str,str] - :raises ~azure.core.exceptions.ResourceExistsError: If the entity already exists + :raises: :class:`~azure.core.exceptions.ResourceExistsError` If the entity already exists + .. admonition:: Example: @@ -373,14 +372,15 @@ async def update_entity( :param entity: The properties for the table entity. :type entity: dict[str, str] :param mode: Merge or Replace entity - :type mode: ~azure.data.tables.UpdateMode + :type mode: :class:`~azure.data.tables.UpdateMode` :keyword str partition_key: The partition key of the entity. :keyword str row_key: The row key of the entity. :keyword str etag: Etag of the entity - :keyword ~azure.core.MatchConditions match_condition: MatchCondition + :keyword match_condition: MatchCondition + :paramtype match_condition: :class:`~azure.core.MatchConditions` :return: Dictionary of operation metadata returned from service :rtype: Dict[str,str] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: :class:`~azure.core.exceptions.HttpResponseError` .. admonition:: Example: @@ -441,10 +441,10 @@ def list_entities( :keyword int results_per_page: Number of entities per page in return AsyncItemPaged :keyword select: Specify desired properties of an entity to return certain entities - :paramtype select: str or list[str] - :return: Query of table entities - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.data.tables.TableEntity] - :raises ~azure.core.exceptions.HttpResponseError: + :paramtype select: str or List[str] + :return: AsyncItemPaged[:class:`~azure.data.tables.TableEntity`] + :rtype: ~azure.core.async_paging.AsyncItemPaged + :raises: :class:`~azure.core.exceptions.HttpResponseError` .. admonition:: Example: @@ -475,17 +475,17 @@ def query_entities( query_filter, **kwargs ): - # type: (...) -> AsyncItemPaged[TableEntity] + # type: (str, **Dict[str, Any]) -> AsyncItemPaged[TableEntity] """Lists entities in a table. - :param str filter: Specify a filter to return certain entities + :param str query_filter: Specify a filter to return certain entities :keyword int results_per_page: Number of entities per page in return AsyncItemPaged :keyword select: Specify desired properties of an entity to return certain entities - :paramtype select: str or list[str] - :keyword dict parameters: Dictionary for formatting query with additional, user defined parameters - :return: Query of table entities - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.data.tables.TableEntity] - :raises ~azure.core.exceptions.HttpResponseError: + :paramtype select: str or List[str] + :keyword Dict[str, Any] parameters: Dictionary for formatting query with additional, user defined parameters + :return: AsyncItemPaged[:class:`~azure.data.tables.TableEntity`] + :rtype: ~azure.core.async_paging.AsyncItemPaged + :raises: :class:`~azure.core.exceptions.HttpResponseError` .. admonition:: Example: @@ -530,8 +530,8 @@ async def get_entity( :param row_key: The row key of the entity. :type row_key: str :return: Dictionary mapping operation metadata returned from the service - :rtype: ~azure.data.tables.TableEntity - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: :class:`~azure.data.tables.TableEntity` + :raises: :class:`~azure.core.exceptions.HttpResponseError` .. admonition:: Example: @@ -567,11 +567,11 @@ async def upsert_entity( :param entity: The properties for the table entity. :type entity: TableEntity or dict[str,str] - :param mode: Merge or Replace and Insert on fail - :type mode: ~azure.data.tables.UpdateMode + :param mode: Merge or Replace entity + :type mode: :class:`~azure.data.tables.UpdateMode` :return: Dictionary mapping operation metadata returned from the service :rtype: Dict[str,str] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: :class:`~azure.core.exceptions.HttpResponseError` .. admonition:: Example: @@ -623,7 +623,7 @@ def create_batch(self, **kwargs: Dict[str, Any]) -> TableBatchOperations: """Create a Batching object from a Table Client :return: Object containing requests and responses - :rtype: ~azure.data.tables.TableBatchOperations + :rtype: :class:`~azure.data.tables.TableBatchOperations` .. admonition:: Example: @@ -650,9 +650,11 @@ async def send_batch( ) -> BatchTransactionResult: """Commit a TableBatchOperations to send requests to the server - :return: Object containing requests and responses - :rtype: ~azure.data.tables.BatchTransactionResult - :raises ~azure.data.tables.BatchErrorException: + :param batch: Batch of operations + :type batch: :class:`~azure.data.tables.TableBatchOperations` + :return: Object containing requests, responses, and original entities + :rtype: :class:`~azure.data.tables.BatchTransactionResult` + :raises: :class:`~azure.data.tables.BatchErrorException` .. admonition:: Example: diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py index be1685ebe920..93fa0b1fcdaa 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py @@ -33,12 +33,12 @@ class TableServiceClient(AsyncTablesBaseClient): This client provides operations to retrieve and configure the account properties as well as list, create and delete tables within the account. - For operations relating to a specific queue, a client for this entity + For operations relating to a specific table, a client for this entity can be retrieved using the :func:`~get_table_client` function. :param str account_url: The URL to the table service endpoint. Any other entities included - in the URL path (e.g. queue) will be discarded. This URL can be optionally + in the URL path (e.g. table) will be discarded. This URL can be optionally authenticated with a SAS token. :param str credential: The credentials with which to authenticate. This is optional if the @@ -91,7 +91,7 @@ def from_connection_string( A connection string to an Azure Storage or Cosmos account. :type conn_str: str :returns: A Table service client. - :rtype: ~azure.data.tables.TableServiceClient + :rtype: :class:`~azure.data.tables.aio.TableServiceClient` .. admonition:: Example: @@ -117,8 +117,8 @@ async def get_service_stats(self, **kwargs): :keyword callable cls: A custom type or function that will be passed the direct response :return: Dictionary of service stats - :rtype: ~azure.data.tables.models.TableServiceStats - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: :class:`~azure.data.tables.models.TableServiceStats` + :raises: :class:`~azure.core.exceptions.HttpResponseError` """ try: timeout = kwargs.pop("timeout", None) @@ -137,8 +137,8 @@ async def get_service_properties(self, **kwargs): :keyword callable cls: A custom type or function that will be passed the direct response :return: TableServiceProperties, or the result of cls(response) - :rtype: ~azure.data.tables.models.TableServiceProperties - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: :class:`~azure.data.tables.models.TableServiceProperties` + :raises: :class:`~azure.core.exceptions.HttpResponseError` """ timeout = kwargs.pop("timeout", None) try: @@ -161,16 +161,15 @@ async def set_service_properties( including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules. :param analytics_logging: Properties for analytics - :type analytics_logging: ~azure.data.tables.TableAnalyticsLogging + :type analytics_logging: :class:`~azure.data.tables.TableAnalyticsLogging` :param hour_metrics: Hour level metrics - :type hour_metrics: ~azure.data.tables.Metrics + :type hour_metrics: :class:`~azure.data.tables.Metrics` :param minute_metrics: Minute level metrics - :type minute_metrics: ~azure.data.tables.Metrics + :type minute_metrics: :class:`~azure.data.tables.Metrics` :param cors: Cross-origin resource sharing rules - :type cors: ~azure.data.tables.CorsRule + :type cors: :class:`~azure.data.tables.CorsRule` :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: + :raises: :class:`~azure.core.exceptions.HttpResponseError` """ props = TableServiceProperties( logging=analytics_logging, @@ -193,11 +192,10 @@ async def create_table( """Creates a new table under the given account. :param headers: - :param table_name: The Table name. - :type table_name: ~azure.data.tables._models.Table + :param str table_name: The Table name. :return: TableClient, or the result of cls(response) - :rtype: ~azure.data.tables.TableClient or None - :raises ~azure.core.exceptions.ResourceExistsError: + :rtype: :class:`~azure.data.tables.aio.TableClient` + :raises: :class:`~azure.core.exceptions.ResourceExistsError` .. admonition:: Example: @@ -226,7 +224,7 @@ async def create_table_if_not_exists( :param table_name: The Table name. :type table_name: str :return: TableClient - :rtype: ~azure.data.tables.aio.TableClient + :rtype: :class:`~azure.data.tables.aio.TableClient` .. admonition:: Example: @@ -253,11 +251,9 @@ async def delete_table( # type: (...) -> None """Deletes the table under the current account - :param table_name: The Table name. - :type table_name: str + :param str table_name: The Table name. :return: None - :rtype: None - :raises ~azure.core.exceptions.ResourceNotFoundError: + :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` .. admonition:: Example: @@ -280,10 +276,10 @@ def list_tables( :keyword int results_per_page: Number of tables per page in return ItemPaged :keyword select: Specify desired properties of a table to return certain tables - :paramtype select: str or list[str] - :return: AsyncItemPaged - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.data.tables.TableItem] - :raises ~azure.core.exceptions.HttpResponseError: + :paramtype select: str or List[str] + :return: AsyncItemPaged[:class:`~azure.data.tables.TableItem`] + :rtype: ~azure.core.async_paging.AsyncItemPaged + :raises: :class:`~azure.core.exceptions.HttpResponseError` .. admonition:: Example: @@ -310,21 +306,20 @@ def list_tables( @distributed_trace def query_tables( self, - query_filter, # type: str - **kwargs # type: Any + query_filter, + **kwargs ): - # type: (...) -> AsyncItemPaged[TableItem] + # type: (str, **Dict[str, Any]) -> AsyncItemPaged[TableItem] """Queries tables under the given account. - :param query_filter: Specify a filter to return certain tables. - :type query_filter: str + :param str query_filter: Specify a filter to return certain tables. :keyword int results_per_page: Number of tables per page in return ItemPaged :keyword select: Specify desired properties of a table to return certain tables - :paramtype select: str or list[str] - :keyword dict[str,str] parameters: Dictionary for formatting query with additional, user defined parameters - :return: An ItemPaged of tables - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.data.tables.TableItem] - :raises ~azure.core.exceptions.HttpResponseError: + :paramtype select: str or List[str] + :keyword Dict[str, Any] parameters: Dictionary for formatting query with additional, user defined parameters + :return: AsyncItemPaged[:class:`~azure.data.tables.TableItem`] + :rtype: ~azure.core.async_paging.AsyncItemPaged + :raises: :class:`~azure.core.exceptions.HttpResponseError` .. admonition:: Example: @@ -362,12 +357,9 @@ def get_table_client( The table need not already exist. - :param table_name: - The queue. This can either be the name of the queue, - or an instance of QueueProperties. - :type table_name: str or ~azure.storage.table.TableProperties - :returns: A :class:`~azure.data.tables.TableClient` object. - :rtype: :class:`~azure.data.tables.TableClient` + :param str table_name: The table name + :returns: A :class:`~azure.data.tables.aio.TableClient` object. + :rtype: :class:`~azure.data.tables.aio.TableClient` """ pipeline = AsyncPipeline( From 8e6e419284b782817c285ea799cef10b217cde68 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 19 Apr 2021 13:55:16 -0400 Subject: [PATCH 04/10] addressing annas comments --- .../azure-data-tables/azure/data/tables/_models.py | 12 ++++++------ .../azure/data/tables/_table_client.py | 2 +- .../azure/data/tables/_table_service_client.py | 2 +- .../azure/data/tables/aio/_table_client_async.py | 2 +- .../data/tables/aio/_table_service_client_async.py | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_models.py b/sdk/tables/azure-data-tables/azure/data/tables/_models.py index f7fae37f5a43..b6418a49272f 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_models.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_models.py @@ -422,7 +422,7 @@ def from_string( permission, **kwargs ): - # Type: (str, **Dict[str]) -> AccountSasPermissions + # Type: (str, Dict[str, Any]) -> AccountSasPermissions """Create AccountSasPermissions from a string. To specify read, write, delete, etc. permissions you need only to @@ -490,14 +490,14 @@ class TableItem(object): """ def __init__(self, table_name, **kwargs): - # type: (str, **Any) -> None + # type: (str, Dict[str, Any]) -> None self.table_name = table_name self.api_version = kwargs.get("version") self.date = kwargs.get("date") or kwargs.get("Date") @classmethod def _from_generated(cls, generated, **kwargs): - # type: (obj, **Any) -> cls + # type: (obj, Dict[str, Any) -> cls return cls(generated.table_name, **kwargs) @@ -550,13 +550,13 @@ class BatchErrorException(HttpResponseError): :param response: Server response to be deserialized. :type response: str :param parts: A list of the parts in multipart response. - :type parts: List[str] + :type parts: :class:`~azure.core.pipeline.transport.HttpResponse` :param args: Args to be passed to :class:`~azure.core.exceptions.HttpResponseError` - :type args: List[str] + :type args: List[:class:`~azure.core.pipeline.transport.HttpResponse`] """ def __init__(self, message, response, parts, *args, **kwargs): - # type: (str, str, List[str], List[str], Dict[str, Any]) -> None + # type: (str, str, HttpResponse, List[HttpResponse], Dict[str, Any]) -> None self.parts = parts super(BatchErrorException, self).__init__( message=message, response=response, *args, **kwargs diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py index 543189ba8a41..76bf078eefba 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -471,7 +471,7 @@ def query_entities( query_filter, **kwargs ): - # type: (str, **Dict[str, Any]) -> ItemPaged[TableEntity] + # type: (str, Dict[str, Any]) -> ItemPaged[TableEntity] """Lists entities in a table. :param str query_filter: Specify a filter to return certain entities diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py index 048da686e170..49b832d585df 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py @@ -253,7 +253,7 @@ def query_tables( query_filter, **kwargs ): - # type: (str, **Dict[str, Any]) -> ItemPaged[TableItem] + # type: (str, Dict[str, Any]) -> ItemPaged[TableItem] """Queries tables under the given account. :param str query_filter: Specify a filter to return certain tables. diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py index c0d3c8b50a60..4331a054d8b6 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py @@ -475,7 +475,7 @@ def query_entities( query_filter, **kwargs ): - # type: (str, **Dict[str, Any]) -> AsyncItemPaged[TableEntity] + # type: (str, Dict[str, Any]) -> AsyncItemPaged[TableEntity] """Lists entities in a table. :param str query_filter: Specify a filter to return certain entities diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py index 93fa0b1fcdaa..096dbabb4786 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py @@ -309,7 +309,7 @@ def query_tables( query_filter, **kwargs ): - # type: (str, **Dict[str, Any]) -> AsyncItemPaged[TableItem] + # type: (str, Dict[str, Any]) -> AsyncItemPaged[TableItem] """Queries tables under the given account. :param str query_filter: Specify a filter to return certain tables. From 1502d428224252843161b0ef1e71c9ac80b74370 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 19 Apr 2021 18:23:15 -0400 Subject: [PATCH 05/10] changes to eng/common file --- .../TestResources/build-test-resource-config.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/eng/common/TestResources/build-test-resource-config.yml b/eng/common/TestResources/build-test-resource-config.yml index 98cdd96f5ad6..46d91d43a65b 100644 --- a/eng/common/TestResources/build-test-resource-config.yml +++ b/eng/common/TestResources/build-test-resource-config.yml @@ -16,10 +16,13 @@ steps: foreach($pair in $config.GetEnumerator()) { if ($pair.Value -is [Hashtable]) { foreach($nestedPair in $pair.Value.GetEnumerator()) { - Write-Host "##vso[task.setvariable variable=$($nestedPair.Name);issecret=true;]$($nestedPair.Value)" + # Mark values as secret so we don't print json blobs containing secrets in the logs. + # Prepend underscore to the variable name, so we can still access the variable names via environment + # variables if they get set subsequently. + Write-Host "##vso[task.setvariable variable=_$($nestedPair.Name);issecret=true;]$($nestedPair.Value)" } } else { - Write-Host "##vso[task.setvariable variable=$($pair.Name);issecret=true;]$($pair.Value)" + Write-Host "##vso[task.setvariable variable=_$($pair.Name);issecret=true;]$($pair.Value)" } } @@ -49,11 +52,14 @@ steps: $config[$pair.Name] = @{} } foreach($nestedPair in $pair.Value.GetEnumerator()) { - Write-Host "##vso[task.setvariable variable=$($nestedPair.Name);issecret=true;]$($nestedPair.Value)" + # Mark values as secret so we don't print json blobs containing secrets in the logs. + # Prepend underscore to the variable name, so we can still access the variable names via environment + # variables if they get set subsequently. + Write-Host "##vso[task.setvariable variable=_$($nestedPair.Name);issecret=true;]$($nestedPair.Value)" $config[$pair.Name][$nestedPair.Name] = $nestedPair.Value } } else { - Write-Host "##vso[task.setvariable variable=$($pair.Name);issecret=true;]$($pair.Value)" + Write-Host "##vso[task.setvariable variable=_$($pair.Name);issecret=true;]$($pair.Value)" $config[$pair.Name] = $pair.Value } } @@ -62,4 +68,4 @@ steps: Write-Host ($config | ConvertTo-Json) Write-Host "##vso[task.setvariable variable=SubscriptionConfiguration;]$serialized" - displayName: Merge Test Resource Configurations + displayName: Merge Test Resource Configurations \ No newline at end of file From d40021645777b3d822af536fd8399ce935893194 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 19 Apr 2021 18:55:38 -0400 Subject: [PATCH 06/10] updating from master --- eng/common/TestResources/build-test-resource-config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/TestResources/build-test-resource-config.yml b/eng/common/TestResources/build-test-resource-config.yml index 46d91d43a65b..9aeaca918df6 100644 --- a/eng/common/TestResources/build-test-resource-config.yml +++ b/eng/common/TestResources/build-test-resource-config.yml @@ -68,4 +68,4 @@ steps: Write-Host ($config | ConvertTo-Json) Write-Host "##vso[task.setvariable variable=SubscriptionConfiguration;]$serialized" - displayName: Merge Test Resource Configurations \ No newline at end of file + displayName: Merge Test Resource Configurations From 703fd0e63ef29ae8b2aca01133eb155f9366c2d6 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Tue, 20 Apr 2021 11:46:19 -0400 Subject: [PATCH 07/10] more apiview related stuff --- .../azure/data/tables/_models.py | 16 +++++++++++----- .../azure/data/tables/_table_batch.py | 13 +++++++++---- .../azure/data/tables/_table_client.py | 19 +++++++++++-------- .../data/tables/_table_service_client.py | 18 +++++++++--------- .../data/tables/aio/_table_batch_async.py | 11 +++++++---- .../data/tables/aio/_table_client_async.py | 15 +++++++++------ .../tables/aio/_table_service_client_async.py | 10 ++++++---- 7 files changed, 62 insertions(+), 40 deletions(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_models.py b/sdk/tables/azure-data-tables/azure/data/tables/_models.py index eaa303f52dd6..0eb19d925d01 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_models.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_models.py @@ -6,6 +6,7 @@ from enum import Enum from azure.core.exceptions import HttpResponseError from azure.core.paging import PageIterator +from typing import TYPE_CHECKING from ._generated.models import TableServiceStats as GenTableServiceStats from ._generated.models import AccessPolicy as GenAccessPolicy @@ -22,6 +23,11 @@ from ._error import _process_table_error from ._constants import NEXT_PARTITION_KEY, NEXT_ROW_KEY, NEXT_TABLE_NAME +if TYPE_CHECKING: + from ._generated.models import TableQueryResponse + from azure.core.pipeline.transport import HttpResponse + from typing import Any, Dict + class TableServiceStats(GenTableServiceStats): """Stats for the service @@ -150,7 +156,7 @@ def __init__( # pylint: disable=super-init-not-called @classmethod def _from_generated(cls, generated): - # type: (...) -> cls + # type: (...) -> Metrics """A summary of request statistics grouped by API in hour or minute aggregates. :param Metrics generated: generated Metrics @@ -194,7 +200,7 @@ def __init__( # pylint: disable=super-init-not-called @classmethod def _from_generated(cls, generated, **kwargs): # pylint: disable=unused-argument - # type: (...) -> cls + # type: (GeneratedRetentionPolicy, Dict[str, Any]) -> RetentionPolicy """The retention policy which determines how long the associated data should persist. @@ -497,7 +503,7 @@ def __init__(self, table_name, **kwargs): @classmethod def _from_generated(cls, generated, **kwargs): - # type: (obj, Dict[str, Any) -> cls + # type: (TableQueryResponse, Dict[str, Any]) -> TableItem return cls(generated.table_name, **kwargs) @@ -550,8 +556,8 @@ class BatchErrorException(HttpResponseError): :param response: Server response to be deserialized. :type response: str :param parts: A list of the parts in multipart response. - :type parts: :class:`~azure.core.pipeline.transport.HttpResponse` - :param args: Args to be passed to :class:`~azure.core.exceptions.HttpResponseError` + :type parts: ~azure.core.pipeline.transport.HttpResponse + :param args: Args to be passed through :type args: List[:class:`~azure.core.pipeline.transport.HttpResponse`] """ diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_batch.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_batch.py index 2ffa8008feca..a1de59e59a90 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_batch.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_batch.py @@ -86,6 +86,7 @@ def create_entity( :param entity: The properties for the table entity. :type entity: TableEntity or dict[str,str] :return: None + :rtype: None :raises ValueError: .. admonition:: Example: @@ -210,11 +211,12 @@ def update_entity( :param entity: The properties for the table entity. :type entity: TableEntity or dict[str,str] :param mode: Merge or Replace entity - :type mode: :class:`~azure.data.tables.UpdateMode` + :type mode: ~azure.data.tables.UpdateMode :keyword str etag: Etag of the entity :keyword match_condition: MatchCondition - :paramtype match_condition: :class:`~azure.core.MatchConditions` + :paramtype match_condition: ~azure.core.MatchCondition :return: None + :rtype: None :raises ValueError: .. admonition:: Example: @@ -298,6 +300,7 @@ def _batch_update_entity( :param query_options: Parameter group. :type query_options: ~azure.data.tables.models.QueryOptions :return: None + :rtype: None """ _format = None @@ -404,6 +407,7 @@ def _batch_merge_entity( :param query_options: Parameter group. :type query_options: ~azure.data.tables.models.QueryOptions :return: None + :rtype: None """ _format = None @@ -490,7 +494,7 @@ def delete_entity( :type row_key: str :keyword str etag: Etag of the entity :keyword match_condition: MatchCondition - :paramtype match_condition: :class:`~azure.core.MatchConditions` + :paramtype match_condition: ~azure.core.MatchCondition :raises ValueError: .. admonition:: Example: @@ -558,6 +562,7 @@ def _batch_delete_entity( :param query_options: Parameter group. :type query_options: ~azure.data.tables.models.QueryOptions :return: None + :rtype: None """ _format = None @@ -629,7 +634,7 @@ def upsert_entity( :param entity: The properties for the table entity. :type entity: TableEntity or dict[str,str] :param mode: Merge or Replace entity - :type mode: :class:`~azure.data.tables.UpdateMode` + :type mode: ~azure.data.tables.UpdateMode :raises ValueError: .. admonition:: Example: diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py index 3919e2f1a488..fdf388562b90 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -181,6 +181,7 @@ def set_table_access_policy( :param signed_identifiers: Access policies to set for the table :type signed_identifiers: Dict[str, :class:`~azure.data.tables.AccessPolicy`] :return: None + :rtype: None :raises: :class:`~azure.core.exceptions.HttpResponseError` """ identifiers = [] @@ -245,6 +246,7 @@ def delete_table( """Deletes the table under the current account. :return: None + :rtype: None :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` If the table does not exist .. admonition:: Example: @@ -277,8 +279,9 @@ def delete_entity( :type row_key: str :keyword str etag: Etag of the entity :keyword match_condition: MatchCondition - :paramtype match_condition: :class:`~azure.core.MatchConditions` + :paramtype match_condition: ~azure.core.MatchConditions :return: None + :rtype: None :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` If the entity already does not exist .. admonition:: Example: @@ -322,7 +325,7 @@ def create_entity( """Insert entity in a table. :param entity: The properties for the table entity. - :type entity: :class:`~azure.data.tables.TableEntity` or Dict[str,str] + :type entity: ~azure.data.tables.TableEntity or Dict[str,str] :return: Dictionary mapping operation metadata returned from the service :rtype: Dict[str,str] :raises: :class:`~azure.core.exceptions.ResourceExistsError` If the entity already exists @@ -362,14 +365,14 @@ def update_entity( """Update entity in a table. :param entity: The properties for the table entity. - :type entity: :class:`~azure.data.tables.TableEntity` or Dict[str,str] + :type entity: ~azure.data.tables.TableEntity or Dict[str,str] :param mode: Merge or Replace entity - :type mode: :class:`~azure.data.tables.UpdateMode` + :type mode: ~azure.data.tables.UpdateMode :keyword str partition_key: The partition key of the entity. :keyword str row_key: The row key of the entity. :keyword str etag: Etag of the entity :keyword match_condition: MatchCondition - :paramtype match_condition: :class:`~azure.core.MatchConditions` + :paramtype match_condition: ~azure.core.MatchCondition :return: Dictionary mapping operation metadata returned from the service :rtype: Dict[str,str] :raises: :class:`~azure.core.exceptions.HttpResponseError` @@ -559,9 +562,9 @@ def upsert_entity( """Update/Merge or Insert entity into table. :param entity: The properties for the table entity. - :type entity: :class:`~azure.data.tables.TableEntity` or Dict[str,str] + :type entity: ~azure.data.tables.TableEntity or Dict[str,str] :param mode: Merge or Replace entity - :type mode: :class:`~azure.data.tables.UpdateMode` + :type mode: ~azure.data.tables.UpdateMode :return: Dictionary mapping operation metadata returned from the service :rtype: Dict[str,str] :raises: :class:`~azure.core.exceptions.HttpResponseError` @@ -641,7 +644,7 @@ def send_batch(self, batch, **kwargs): """Commit a TableBatchOperations to send requests to the server :param batch: Batch of operations - :type batch: :class:`~azure.data.tables.TableBatchOperations` + :type batch: ~azure.data.tables.TableBatchOperations :return: A list of tuples, each containing the entity operated on, and a dictionary of metadata returned from the service. :rtype: List[Tuple[Mapping[str, Any], Mapping[str, Any]]] diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py index 49b832d585df..c4cb3ead1740 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py @@ -5,7 +5,7 @@ # -------------------------------------------------------------------------- import functools -from typing import Any, Union +from typing import Any, Union, Optional, Dict from azure.core.exceptions import HttpResponseError, ResourceExistsError from azure.core.paging import ItemPaged from azure.core.tracing.decorator import distributed_trace @@ -139,14 +139,15 @@ def set_service_properties( including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules. :param analytics_logging: Properties for analytics - :type analytics_logging: :class:`~azure.data.tables.TableAnalyticsLogging` + :type analytics_logging: ~azure.data.tables.TableAnalyticsLogging :param hour_metrics: Hour level metrics - :type hour_metrics: :class:`~azure.data.tables.Metrics` + :type hour_metrics: ~azure.data.tables.Metrics :param minute_metrics: Minute level metrics - :type minute_metrics: :class:`~azure.data.tables.Metrics` + :type minute_metrics: ~azure.data.tables.Metrics :param cors: Cross-origin resource sharing rules - :type cors: :class:`~azure.data.tables.CorsRule` + :type cors: ~azure.data.tables.CorsRule :return: None + :rtype: None :raises: :class:`~azure.core.exceptions.HttpResponseError` """ props = TableServiceProperties( @@ -233,6 +234,7 @@ def delete_table( :param table_name: The Table name. :type table_name: str :return: None + :rtype: None :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` .. admonition:: Example: @@ -293,10 +295,8 @@ def query_tables( ) @distributed_trace - def list_tables( - self, **kwargs # type: Any - ): - # type: (...) -> ItemPaged[TableItem] + def list_tables(self, **kwargs): + # type: (Any) -> ItemPaged[TableItem] """Queries tables under the given account. :keyword int results_per_page: Number of tables per page in return ItemPaged diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_batch_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_batch_async.py index ff3c40dfbc00..f07cde4bca8c 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_batch_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_batch_async.py @@ -75,6 +75,7 @@ def create_entity( :param entity: The properties for the table entity. :type entity: TableEntity or dict[str,str] :return: None + :rtype: None :raises ValueError: .. admonition:: Example: @@ -199,11 +200,12 @@ def update_entity( :param entity: The properties for the table entity. :type entity: TableEntity or Dict[str,str] :param mode: Merge or Replace entity - :type mode: :class:`~azure.data.tables.UpdateMode` + :type mode: ~azure.data.tables.UpdateMode :keyword str etag: Etag of the entity :keyword match_condition: MatchCondition - :paramtype match_condition: :class:`~azure.core.MatchConditions` + :paramtype match_condition: ~azure.core.MatchCondition :return: None + :rtype: None :raises ValueError: .. admonition:: Example: @@ -476,7 +478,7 @@ def delete_entity( :type row_key: str :keyword str etag: Etag of the entity :keyword match_condition: MatchCondition - :paramtype match_condition: :class:`~azure.core.MatchConditions` + :paramtype match_condition: ~azure.core.MatchCondition .. admonition:: Example: @@ -612,8 +614,9 @@ def upsert_entity( :param entity: The properties for the table entity. :type entity: TableEntity or dict[str,str] :param mode: Merge or Replace entity - :type mode: :class:`~azure.data.tables.UpdateMode` + :type mode: ~azure.data.tables.UpdateMode :return: None + :rtype: None :raises ValueError: .. admonition:: Example: diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py index 22689c484eef..8f05daa058aa 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py @@ -193,6 +193,7 @@ async def set_table_access_policy( :param signed_identifiers: Access policies to set for the table :type signed_identifiers: Dict[str, :class:`~azure.data.tables.AccessPolicy`] :return: None + :rtype: None :raises: :class:`~azure.core.exceptions.HttpResponseError` """ identifiers = [] @@ -257,6 +258,7 @@ async def delete_table( """Deletes the table under the current account. :return: None + :rtype: None :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` If the table does not exist .. admonition:: Example: @@ -289,8 +291,9 @@ async def delete_entity( :type row_key: str :keyword str etag: Etag of the entity :keyword match_condition: MatchCondition - :paramtype match_condition: :class:`~azure.core.MatchConditions` + :paramtype match_condition: ~azure.core.MatchConditions :return: None + :rtype: None :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` If the entity already does not exist .. admonition:: Example: @@ -332,7 +335,7 @@ async def create_entity( """Insert entity in a table. :param entity: The properties for the table entity. - :type entity: :class:`~azure.data.tables.TableEntity` or Dict[str,str] + :type entity: ~azure.data.tables.TableEntity or Dict[str,str] :return: Dictionary mapping operation metadata returned from the service :rtype: Dict[str,str] :raises: :class:`~azure.core.exceptions.ResourceExistsError` If the entity already exists @@ -375,12 +378,12 @@ async def update_entity( :param entity: The properties for the table entity. :type entity: dict[str, str] :param mode: Merge or Replace entity - :type mode: :class:`~azure.data.tables.UpdateMode` + :type mode: ~azure.data.tables.UpdateMode :keyword str partition_key: The partition key of the entity. :keyword str row_key: The row key of the entity. :keyword str etag: Etag of the entity :keyword match_condition: MatchCondition - :paramtype match_condition: :class:`~azure.core.MatchConditions` + :paramtype match_condition: ~azure.core.MatchCondition :return: Dictionary of operation metadata returned from service :rtype: Dict[str,str] :raises: :class:`~azure.core.exceptions.HttpResponseError` @@ -571,7 +574,7 @@ async def upsert_entity( :param entity: The properties for the table entity. :type entity: TableEntity or dict[str,str] :param mode: Merge or Replace entity - :type mode: :class:`~azure.data.tables.UpdateMode` + :type mode: ~azure.data.tables.UpdateMode :return: Dictionary mapping operation metadata returned from the service :rtype: Dict[str,str] :raises: :class:`~azure.core.exceptions.HttpResponseError` @@ -653,7 +656,7 @@ async def send_batch( """Commit a TableBatchOperations to send requests to the server :param batch: Batch of operations - :type batch: :class:`~azure.data.tables.TableBatchOperations` + :type batch: ~azure.data.tables.TableBatchOperations :return: A list of tuples, each containing the entity operated on, and a dictionary of metadata returned from the service. :rtype: List[Tuple[Mapping[str, Any], Mapping[str, Any]]] diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py index 096dbabb4786..ea732d250c30 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py @@ -161,14 +161,15 @@ async def set_service_properties( including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules. :param analytics_logging: Properties for analytics - :type analytics_logging: :class:`~azure.data.tables.TableAnalyticsLogging` + :type analytics_logging: ~azure.data.tables.TableAnalyticsLogging :param hour_metrics: Hour level metrics - :type hour_metrics: :class:`~azure.data.tables.Metrics` + :type hour_metrics: ~azure.data.tables.Metrics :param minute_metrics: Minute level metrics - :type minute_metrics: :class:`~azure.data.tables.Metrics` + :type minute_metrics: ~azure.data.tables.Metrics :param cors: Cross-origin resource sharing rules - :type cors: :class:`~azure.data.tables.CorsRule` + :type cors: ~azure.data.tables.CorsRule :return: None + :rtype: None :raises: :class:`~azure.core.exceptions.HttpResponseError` """ props = TableServiceProperties( @@ -253,6 +254,7 @@ async def delete_table( :param str table_name: The Table name. :return: None + :rtype: None :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` .. admonition:: Example: From a0b647d524252e59b87f03531d622b836f55784d Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Tue, 20 Apr 2021 12:57:21 -0400 Subject: [PATCH 08/10] pylint fix --- .../azure/data/tables/_models.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_models.py b/sdk/tables/azure-data-tables/azure/data/tables/_models.py index 3b83616eb62f..3c5f6bc379c6 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_models.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_models.py @@ -4,9 +4,10 @@ # license information. # -------------------------------------------------------------------------- from enum import Enum +from typing import TYPE_CHECKING + from azure.core.exceptions import HttpResponseError from azure.core.paging import PageIterator -from typing import TYPE_CHECKING from ._generated.models import TableServiceStats as GenTableServiceStats from ._generated.models import AccessPolicy as GenAccessPolicy @@ -26,7 +27,7 @@ if TYPE_CHECKING: from ._generated.models import TableQueryResponse from azure.core.pipeline.transport import HttpResponse - from typing import Any, Dict + from typing import Any, Dict, List class TableServiceStats(GenTableServiceStats): @@ -487,16 +488,21 @@ def service_properties_deserialize(generated): class TableItem(object): """ - Represents an Azure TableItem. Returned by TableServiceClient.list_tables - and TableServiceClient.query_tables. + Represents an Azure TableItem. + Returned by TableServiceClient.list_tables and TableServiceClient.query_tables. - :param str name: The name of the table. + :ivar str name: The name of the table. :ivar str api_version: The API version included in the service call :ivar str date: The date the service call was made """ def __init__(self, name, **kwargs): # type: (str, Dict[str, Any]) -> None + """ + :param str name: Name of the Table + :keyword str api_version: The API version included in the service call + :keyword str date: The date the service call was made + """ self.name = name self.api_version = kwargs.get("version") self.date = kwargs.get("date") or kwargs.get("Date") From 8787e0416e38bc35b74a107fb9dcb7a0479fdc40 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Tue, 20 Apr 2021 15:51:11 -0400 Subject: [PATCH 09/10] added small fixes to apiview --- .../azure-data-tables/azure/data/tables/_models.py | 2 +- .../azure/data/tables/_table_client.py | 5 ++++- .../azure/data/tables/_table_service_client.py | 1 - .../azure/data/tables/aio/_table_client_async.py | 10 +++++----- .../data/tables/aio/_table_service_client_async.py | 2 -- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_models.py b/sdk/tables/azure-data-tables/azure/data/tables/_models.py index 3c5f6bc379c6..788983ad7bcd 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_models.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_models.py @@ -140,7 +140,7 @@ class Metrics(GeneratedMetrics): :keyword str version: The version of Storage Analytics to configure. :keyword bool enabled: Required. Indicates whether metrics are enabled for the service. - :keyword bool include_ap_is: Indicates whether metrics should generate summary + :keyword bool include_apis: Indicates whether metrics should generate summary statistics for called API operations. :keyword ~azure.data.tables.RetentionPolicy retention_policy: Required. The retention policy for the metrics. diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py index fdf388562b90..4425f5c7607f 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -34,7 +34,10 @@ class TableClient(TablesBaseClient): - """ :ivar str account_name: Name of the storage account (Cosmos or Azure)""" + """ + :ivar str account_name: Name of the storage account (Cosmos or Azure) + :ivar str table_name: The name of the table + """ def __init__( self, diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py index c4cb3ead1740..c80e1c54d238 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_service_client.py @@ -94,7 +94,6 @@ def get_service_stats(self, **kwargs): """Retrieves statistics related to replication for the Table service. It is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the account. - :keyword callable cls: A custom type or function that will be passed the direct response :return: Dictionary of service stats :rtype: :class:`~azure.data.tables.models.TableServiceStats` :raises: :class:`~azure.core.exceptions.HttpResponseError:` diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py index 8f05daa058aa..feea6d3648bd 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py @@ -40,7 +40,10 @@ class TableClient(AsyncTablesBaseClient): - """ :ivar str account_name: Name of the storage account (Cosmos or Azure)""" + """ + :ivar str account_name: Name of the storage account (Cosmos or Azure) + :ivar str table_name: The name of the table + """ def __init__( self, @@ -153,10 +156,7 @@ def from_table_url(cls, table_url, credential=None, **kwargs): return cls(account_url, table_name=table_name, credential=credential, **kwargs) @distributed_trace_async - async def get_table_access_policy( - self, **kwargs # type: Any - ): - # type: (...) -> dict[str,AccessPolicy] + async def get_table_access_policy(self, **kwargs: Any) -> Dict[str, AccessPolicy]: """ Retrieves details about any stored access policies specified on the table that may be used with Shared Access Signatures. diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py index ea732d250c30..ea880e900406 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_service_client_async.py @@ -114,8 +114,6 @@ async def get_service_stats(self, **kwargs): """Retrieves statistics related to replication for the Table service. It is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the account. - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Dictionary of service stats :rtype: :class:`~azure.data.tables.models.TableServiceStats` :raises: :class:`~azure.core.exceptions.HttpResponseError` From 4c2a5f96004446a60b04f907353791321d955599 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Fri, 23 Apr 2021 15:32:04 -0400 Subject: [PATCH 10/10] remove partkey and rowkey from kwargs in update_entity --- sdk/tables/azure-data-tables/azure/data/tables/_table_client.py | 2 -- .../azure/data/tables/aio/_table_client_async.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py index 4425f5c7607f..fedba022d1df 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -371,8 +371,6 @@ def update_entity( :type entity: ~azure.data.tables.TableEntity or Dict[str,str] :param mode: Merge or Replace entity :type mode: ~azure.data.tables.UpdateMode - :keyword str partition_key: The partition key of the entity. - :keyword str row_key: The row key of the entity. :keyword str etag: Etag of the entity :keyword match_condition: MatchCondition :paramtype match_condition: ~azure.core.MatchCondition diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py index feea6d3648bd..e8686630e0f1 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py @@ -379,8 +379,6 @@ async def update_entity( :type entity: dict[str, str] :param mode: Merge or Replace entity :type mode: ~azure.data.tables.UpdateMode - :keyword str partition_key: The partition key of the entity. - :keyword str row_key: The row key of the entity. :keyword str etag: Etag of the entity :keyword match_condition: MatchCondition :paramtype match_condition: ~azure.core.MatchCondition