From 34093f8417121e5e367c65a7bd6ec1fed8b62e30 Mon Sep 17 00:00:00 2001 From: xiafu Date: Thu, 17 Sep 2020 00:00:52 -0700 Subject: [PATCH 1/2] [Storage]API Review Comments --- .../azure/storage/blob/_blob_client.py | 51 ++++++++++--------- .../azure/storage/blob/_container_client.py | 10 ++-- .../azure/storage/blob/_lease.py | 10 ++-- .../storage/blob/aio/_blob_client_async.py | 46 ++++++++--------- .../blob/aio/_container_client_async.py | 10 ++-- .../azure/storage/blob/aio/_lease_async.py | 10 ++-- .../filedatalake/_data_lake_file_client.py | 5 +- .../azure/storage/filedatalake/_models.py | 8 +-- 8 files changed, 76 insertions(+), 74 deletions(-) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py index e52714d721f1..de39d2fc8c21 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py @@ -476,7 +476,7 @@ def upload_blob( # pylint: disable=too-many-locals and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -636,7 +636,7 @@ def download_blob(self, offset=None, length=None, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -729,7 +729,7 @@ def query_blob(self, query_expression, **kwargs): :param str query_expression: Required. a query statement. - :keyword Callable[Exception] on_error: + :keyword Callable[~azure.storage.blob.BlobQueryError] on_error: A function to be called on any processing errors returned by the service. :keyword blob_format: Optional. Defines the serialization of the data currently stored in the blob. The default is to @@ -740,7 +740,8 @@ def query_blob(self, query_expression, **kwargs): Optional. Defines the output serialization for the data stream. By default the data will be returned as it is represented in the blob. By providing an output format, the blob data will be reformatted according to that profile. This value can be a DelimitedTextDialect or a DelimitedJsonDialect. - :paramtype output_format: ~azure.storage.blob.DelimitedTextDialect or ~azure.storage.blob.DelimitedJsonDialect + :paramtype output_format: ~azure.storage.blob.DelimitedTextDialect, ~azure.storage.blob.DelimitedJsonDialect + or list[~azure.storage.blob.ArrowDialect] :keyword lease: Required if the blob has an active lease. Value can be a BlobLeaseClient object or the lease ID as a string. @@ -762,7 +763,7 @@ def query_blob(self, query_expression, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -879,7 +880,7 @@ def delete_blob(self, delete_snapshots=False, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -989,7 +990,7 @@ def get_blob_properties(self, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1095,7 +1096,7 @@ def set_http_headers(self, content_settings=None, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1169,7 +1170,7 @@ def set_blob_metadata(self, metadata=None, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1516,7 +1517,7 @@ def create_snapshot(self, metadata=None, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on destination blob with a matching value. .. versionadded:: 12.4.0 @@ -1834,7 +1835,7 @@ def acquire_lease(self, lease_duration=-1, lease_id=None, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1882,7 +1883,7 @@ def set_standard_blob_tier(self, standard_blob_tier, **kwargs): .. versionadded:: 12.4.0 This keyword argument was introduced in API version '2019-12-12'. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -2141,7 +2142,7 @@ def get_block_list(self, block_list_type="committed", **kwargs): Required if the blob has an active lease. Value can be a BlobLeaseClient object or the lease ID as a string. :paramtype lease: ~azure.storage.blob.BlobLeaseClient or str - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on destination blob with a matching value. .. versionadded:: 12.4.0 @@ -2287,7 +2288,7 @@ def commit_block_list( # type: ignore and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on destination blob with a matching value. .. versionadded:: 12.4.0 @@ -2333,7 +2334,7 @@ def set_premium_page_blob_tier(self, premium_page_blob_tier, **kwargs): blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. :type premium_page_blob_tier: ~azure.storage.blob.PremiumPageBlobTier - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -2402,7 +2403,7 @@ def set_blob_tags(self, tags=None, **kwargs): bitflips on the wire if using http instead of https, as https (the default), will already validate. Note that this MD5 hash is not stored with the blob. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on destination blob with a matching value. :keyword int timeout: The timeout parameter is expressed in seconds. @@ -2438,7 +2439,7 @@ def get_blob_tags(self, **kwargs): :keyword str version_id: The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to add tags to. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on destination blob with a matching value. :keyword int timeout: The timeout parameter is expressed in seconds. @@ -2535,7 +2536,7 @@ def get_page_ranges( # type: ignore and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -2684,7 +2685,7 @@ def set_sequence_number(self, sequence_number_action, sequence_number=None, **kw and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -2758,7 +2759,7 @@ def resize_blob(self, size, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -2888,7 +2889,7 @@ def upload_page( # type: ignore and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -3060,7 +3061,7 @@ def upload_pages_from_url(self, source_url, # type: str and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The destination match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -3177,7 +3178,7 @@ def clear_page(self, offset, length, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -3307,7 +3308,7 @@ def append_block( # type: ignore and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -3454,7 +3455,7 @@ def append_block_from_url(self, copy_source_url, # type: str and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The destination match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_container_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_container_client.py index 575611c4e7a9..d561ab97a22d 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_container_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_container_client.py @@ -782,7 +782,7 @@ def upload_blob( and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -898,7 +898,7 @@ def delete_blob( and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -963,7 +963,7 @@ def download_blob(self, blob, offset=None, length=None, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1163,7 +1163,7 @@ def delete_blobs(self, *blobs, **kwargs): If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1332,7 +1332,7 @@ def set_standard_blob_tier_blobs( :type blobs: list[str], list[dict], or list[~azure.storage.blob.BlobProperties] :keyword ~azure.storage.blob.RehydratePriority rehydrate_priority: Indicates the priority with which to rehydrate an archived blob - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_lease.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_lease.py index 6180d7851aae..1fd668c0f9b3 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_lease.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_lease.py @@ -96,7 +96,7 @@ def acquire(self, lease_duration=-1, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -149,7 +149,7 @@ def renew(self, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -199,7 +199,7 @@ def release(self, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -248,7 +248,7 @@ def change(self, proposed_lease_id, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -307,7 +307,7 @@ def break_lease(self, lease_break_period=None, **kwargs): If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_client_async.py index 425a49e4a9b9..28d60fc5b6d4 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_client_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_client_async.py @@ -206,7 +206,7 @@ async def upload_blob( and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -322,7 +322,7 @@ async def download_blob(self, offset=None, length=None, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -410,7 +410,7 @@ async def delete_blob(self, delete_snapshots=False, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -520,7 +520,7 @@ async def get_blob_properties(self, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -602,7 +602,7 @@ async def set_http_headers(self, content_settings=None, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -650,7 +650,7 @@ async def set_blob_metadata(self, metadata=None, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -869,7 +869,7 @@ async def create_snapshot(self, metadata=None, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1019,7 +1019,7 @@ async def start_copy_from_url(self, source_url, metadata=None, incremental_copy= and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The destination match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1139,7 +1139,7 @@ async def acquire_lease(self, lease_duration=-1, lease_id=None, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1181,7 +1181,7 @@ async def set_standard_blob_tier(self, standard_blob_tier, **kwargs): :type standard_blob_tier: str or ~azure.storage.blob.StandardBlobTier :keyword ~azure.storage.blob.RehydratePriority rehydrate_priority: Indicates the priority with which to rehydrate an archived blob - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1339,7 +1339,7 @@ async def get_block_list(self, block_list_type="committed", **kwargs): Required if the blob has an active lease. Value can be a BlobLeaseClient object or the lease ID as a string. :paramtype lease: ~azure.storage.blob.aio.BlobLeaseClient or str - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1421,7 +1421,7 @@ async def commit_block_list( # type: ignore and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1468,7 +1468,7 @@ async def set_premium_page_blob_tier(self, premium_page_blob_tier, **kwargs): blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts. :type premium_page_blob_tier: ~azure.storage.blob.PremiumPageBlobTier - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1525,7 +1525,7 @@ async def set_blob_tags(self, tags=None, **kwargs): bitflips on the wire if using http instead of https, as https (the default), will already validate. Note that this MD5 hash is not stored with the blob. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" :keyword int timeout: @@ -1550,7 +1550,7 @@ async def get_blob_tags(self, **kwargs): :keyword str version_id: The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to add tags to. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" :keyword int timeout: @@ -1615,7 +1615,7 @@ async def get_page_ranges( # type: ignore and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1752,7 +1752,7 @@ async def set_sequence_number( # type: ignore and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1802,7 +1802,7 @@ async def resize_blob(self, size, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1882,7 +1882,7 @@ async def upload_page( # type: ignore and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1995,7 +1995,7 @@ async def upload_pages_from_url(self, source_url, # type: str and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The destination match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -2075,7 +2075,7 @@ async def clear_page(self, offset, length, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -2150,7 +2150,7 @@ async def append_block( # type: ignore and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -2238,7 +2238,7 @@ async def append_block_from_url(self, copy_source_url, # type: str and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The destination match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_container_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_container_client_async.py index 0554fc661459..5c5e5940877c 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_container_client_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_container_client_async.py @@ -657,7 +657,7 @@ async def upload_blob( and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -773,7 +773,7 @@ async def delete_blob( and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -838,7 +838,7 @@ async def download_blob(self, blob, offset=None, length=None, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -927,7 +927,7 @@ async def delete_blobs( # pylint: disable=arguments-differ If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -1005,7 +1005,7 @@ async def set_standard_blob_tier_blobs( :type blobs: list[str], list[dict], or list[~azure.storage.blob.BlobProperties] :keyword ~azure.storage.blob.RehydratePriority rehydrate_priority: Indicates the priority with which to rehydrate an archived blob - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_lease_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_lease_async.py index 5f68a9b7b874..91bf93d04893 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_lease_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_lease_async.py @@ -92,7 +92,7 @@ async def acquire(self, lease_duration=-1, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -145,7 +145,7 @@ async def renew(self, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -195,7 +195,7 @@ async def release(self, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -244,7 +244,7 @@ async def change(self, proposed_lease_id, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" @@ -303,7 +303,7 @@ async def break_lease(self, lease_break_period=None, **kwargs): If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has not been modified since the specified date/time. - :keyword str if_tags_match_condition + :keyword str if_tags_match_condition: Specify a SQL where clause on blob tags to operate only on blob with a matching value. eg. "\"tagname\"='my tag'" diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py index e9478000cb19..1d09ef6c793c 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py @@ -671,7 +671,7 @@ def query_file(self, query_expression, **kwargs): :param str query_expression: Required. a query statement. eg. Select * from DataLakeStorage - :keyword Callable[Exception] on_error: + :keyword Callable[~azure.storage.filedatalake.DataLakeFileQueryError] on_error: A function to be called on any processing errors returned by the service. :keyword file_format: Optional. Defines the serialization of the data currently stored in the file. The default is to @@ -684,7 +684,8 @@ def query_file(self, query_expression, **kwargs): as it is represented in the file. By providing an output format, the file data will be reformatted according to that profile. This value can be a DelimitedTextDialect or a DelimitedJsonDialect. :paramtype output_format: - ~azure.storage.filedatalake.DelimitedTextDialect or ~azure.storage.filedatalake.DelimitedJsonDialect + ~azure.storage.filedatalake.DelimitedTextDialect, ~azure.storage.filedatalake.DelimitedJsonDialect + or list[~azure.storage.filedatalake.ArrowDialect] :keyword lease: Required if the file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_models.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_models.py index f2ad47980ef7..3f40b4029ba5 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_models.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_models.py @@ -662,7 +662,7 @@ def __init__(self, error=None, is_fatal=False, description=None, position=None): self.position = position -class AccessControlChangeCounters(object): +class AccessControlChangeCounters(DictMixin): """ AccessControlChangeCounters contains counts of operations that change Access Control Lists recursively. @@ -680,7 +680,7 @@ def __init__(self, directories_successful, files_successful, failure_count): self.failure_count = failure_count -class AccessControlChangeResult(object): +class AccessControlChangeResult(DictMixin): """ AccessControlChangeResult contains result of operations that change Access Control Lists recursively. @@ -696,7 +696,7 @@ def __init__(self, counters, continuation): self.continuation = continuation -class AccessControlChangeFailure(object): +class AccessControlChangeFailure(DictMixin): """ Represents an entry that failed to update Access Control List. @@ -714,7 +714,7 @@ def __init__(self, name, is_directory, error_message): self.error_message = error_message -class AccessControlChanges(object): +class AccessControlChanges(DictMixin): """ AccessControlChanges contains batch and cumulative counts of operations that change Access Control Lists recursively. From d519d01a4c7f948db4fb53352762cbbfea3bb321 Mon Sep 17 00:00:00 2001 From: xiafu Date: Thu, 24 Sep 2020 15:25:27 -0700 Subject: [PATCH 2/2] move new_name for undelete_container to kwargs --- .../azure/storage/blob/_blob_service_client.py | 6 ++++-- .../azure/storage/blob/aio/_blob_service_client_async.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_service_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_service_client.py index fc1249cf8c02..f68a68009112 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_service_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_service_client.py @@ -564,7 +564,7 @@ def delete_container( **kwargs) @distributed_trace - def undelete_container(self, deleted_container_name, deleted_container_version, new_name=None, **kwargs): + def undelete_container(self, deleted_container_name, deleted_container_version, **kwargs): # type: (str, str, str, **Any) -> ContainerClient """Restores soft-deleted container. @@ -578,12 +578,14 @@ def undelete_container(self, deleted_container_name, deleted_container_version, Specifies the name of the deleted container to restore. :param str deleted_container_version: Specifies the version of the deleted container to restore. - :param str new_name: + :keyword str new_name: The new name for the deleted container to be restored to. + If not specified deleted_container_name will be used as the restored container name. :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: ~azure.storage.blob.ContainerClient """ + new_name = kwargs.pop('new_name', None) container = self.get_container_client(new_name or deleted_container_name) try: container._client.container.restore(deleted_container_name=deleted_container_name, # pylint: disable = protected-access diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_service_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_service_client_async.py index 7ccb4237bc10..86422827efe3 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_service_client_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_service_client_async.py @@ -517,7 +517,7 @@ async def delete_container( **kwargs) @distributed_trace_async - async def undelete_container(self, deleted_container_name, deleted_container_version, new_name=None, **kwargs): + async def undelete_container(self, deleted_container_name, deleted_container_version, **kwargs): # type: (str, str, str, **Any) -> ContainerClient """Restores soft-deleted container. @@ -531,12 +531,14 @@ async def undelete_container(self, deleted_container_name, deleted_container_ver Specifies the name of the deleted container to restore. :param str deleted_container_version: Specifies the version of the deleted container to restore. - :param str new_name: + :keyword str new_name: The new name for the deleted container to be restored to. + If not specified deleted_container_name will be used as the restored container name. :keyword int timeout: The timeout parameter is expressed in seconds. :rtype: ~azure.storage.blob.aio.ContainerClient """ + new_name = kwargs.pop('new_name', None) container = self.get_container_client(new_name or deleted_container_name) try: await container._client.container.restore(deleted_container_name=deleted_container_name, # pylint: disable = protected-access