Skip to content

Commit e7d7ccd

Browse files
[Storage] Updated credentials formatting in docstrings and disabled docstring-keyword-should-match-keyword-only (#35296)
1 parent fced949 commit e7d7ccd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+270
-53
lines changed

sdk/storage/azure-storage-blob-changefeed/azure/storage/blob/changefeed/_change_feed_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6-
# pylint: disable=too-many-lines
6+
# pylint: disable=too-many-lines, docstring-keyword-should-match-keyword-only
7+
78
from typing import (
89
Any, Dict, Optional, Union,
910
TYPE_CHECKING

sdk/storage/azure-storage-blob/azure/storage/blob/__init__.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6+
# pylint: disable=docstring-keyword-should-match-keyword-only
7+
68
import os
79

810
from typing import Union, Iterable, AnyStr, IO, Any, Dict # pylint: disable=unused-import
@@ -92,7 +94,11 @@ def upload_blob_to_url(
9294
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
9395
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
9496
should be the storage account key.
95-
:type credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, "TokenCredential"]] # pylint: disable=line-too-long
97+
:type credential:
98+
~azure.core.credentials.AzureNamedKeyCredential or
99+
~azure.core.credentials.AzureSasCredential or
100+
~azure.core.credentials.TokenCredential or
101+
str or dict[str, str] or None
96102
:keyword bool overwrite:
97103
Whether the blob to be uploaded should overwrite the current data.
98104
If True, upload_blob_to_url will overwrite any existing data. If set to False, the
@@ -156,7 +162,11 @@ def download_blob_from_url(
156162
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
157163
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
158164
should be the storage account key.
159-
:type credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, "TokenCredential"]] # pylint: disable=line-too-long
165+
:type credential:
166+
~azure.core.credentials.AzureNamedKeyCredential or
167+
~azure.core.credentials.AzureSasCredential or
168+
~azure.core.credentials.TokenCredential or
169+
str or dict[str, str] or None
160170
:keyword bool overwrite:
161171
Whether the local file should be overwritten if it already exists. The default value is
162172
`False` - in which case a ValueError will be raised if the file already exists. If set to

sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6-
# pylint: disable=too-many-lines
6+
# pylint: disable=too-many-lines, docstring-keyword-should-match-keyword-only
77

88
from functools import partial
99
from io import BytesIO
@@ -237,7 +237,11 @@ def from_blob_url(
237237
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
238238
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
239239
should be the storage account key.
240-
:type credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] # pylint: disable=line-too-long
240+
:type credential:
241+
~azure.core.credentials.AzureNamedKeyCredential or
242+
~azure.core.credentials.AzureSasCredential or
243+
~azure.core.credentials.TokenCredential or
244+
str or dict[str, str] or None
241245
:param str snapshot:
242246
The optional blob snapshot on which to operate. This can be the snapshot ID string
243247
or the response returned from :func:`create_snapshot`. If specified, this will override
@@ -326,7 +330,11 @@ def from_connection_string(
326330
Credentials provided here will take precedence over those in the connection string.
327331
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
328332
should be the storage account key.
329-
:type credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] # pylint: disable=line-too-long
333+
:type credential:
334+
~azure.core.credentials.AzureNamedKeyCredential or
335+
~azure.core.credentials.AzureSasCredential or
336+
~azure.core.credentials.TokenCredential or
337+
str or dict[str, str] or None
330338
:keyword str version_id: The version id parameter is an opaque DateTime value that, when present,
331339
specifies the version of the blob to operate on.
332340
:keyword str audience: The audience to use when requesting tokens for Azure Active Directory

sdk/storage/azure-storage-blob/azure/storage/blob/_blob_service_client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6+
# pylint: disable=docstring-keyword-should-match-keyword-only
67

78
import functools
89
import warnings
@@ -171,7 +172,11 @@ def from_connection_string(
171172
Credentials provided here will take precedence over those in the connection string.
172173
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
173174
should be the storage account key.
174-
:type credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] # pylint: disable=line-too-long
175+
:type credential:
176+
~azure.core.credentials.AzureNamedKeyCredential or
177+
~azure.core.credentials.AzureSasCredential or
178+
~azure.core.credentials.TokenCredential or
179+
str or dict[str, str] or None
175180
:keyword str audience: The audience to use when requesting tokens for Azure Active Directory
176181
authentication. Only has an effect when credential is of type TokenCredential. The value could be
177182
https://storage.azure.com/ (default) or https://<account>.blob.core.windows.net.

sdk/storage/azure-storage-blob/azure/storage/blob/_container_client.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# pylint: disable=too-many-lines
21
# -------------------------------------------------------------------------
32
# Copyright (c) Microsoft Corporation. All rights reserved.
43
# Licensed under the MIT License. See License.txt in the project root for
54
# license information.
65
# --------------------------------------------------------------------------
6+
# pylint: disable=too-many-lines, docstring-keyword-should-match-keyword-only
77

88
import functools
99
import warnings
@@ -202,7 +202,11 @@ def from_container_url(
202202
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
203203
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
204204
should be the storage account key.
205-
:type credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] = None, # pylint: disable=line-too-long
205+
:type credential:
206+
~azure.core.credentials.AzureNamedKeyCredential or
207+
~azure.core.credentials.AzureSasCredential or
208+
~azure.core.credentials.TokenCredential or
209+
str or dict[str, str] or None
206210
:keyword str audience: The audience to use when requesting tokens for Azure Active Directory
207211
authentication. Only has an effect when credential is of type TokenCredential. The value could be
208212
https://storage.azure.com/ (default) or https://<account>.blob.core.windows.net.
@@ -251,7 +255,11 @@ def from_connection_string(
251255
Credentials provided here will take precedence over those in the connection string.
252256
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
253257
should be the storage account key.
254-
:type credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] = None, # pylint: disable=line-too-long
258+
:type credential:
259+
~azure.core.credentials.AzureNamedKeyCredential or
260+
~azure.core.credentials.AzureSasCredential or
261+
~azure.core.credentials.TokenCredential or
262+
str or dict[str, str] or None
255263
:keyword str audience: The audience to use when requesting tokens for Azure Active Directory
256264
authentication. Only has an effect when credential is of type TokenCredential. The value could be
257265
https://storage.azure.com/ (default) or https://<account>.blob.core.windows.net.

sdk/storage/azure-storage-blob/azure/storage/blob/_lease.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6+
# pylint: disable=docstring-keyword-should-match-keyword-only
67

78
import uuid
89

sdk/storage/azure-storage-blob/azure/storage/blob/_shared/shared_access_signature.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6+
# pylint: disable=docstring-keyword-should-match-keyword-only
67

78
from datetime import date
89

sdk/storage/azure-storage-blob/azure/storage/blob/_shared_access_signature.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6+
# pylint: disable=docstring-keyword-should-match-keyword-only
67

78
from typing import ( # pylint: disable=unused-import
89
Union, Optional, Any, TYPE_CHECKING

sdk/storage/azure-storage-blob/azure/storage/blob/aio/__init__.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6+
# pylint: disable=docstring-keyword-should-match-keyword-only
67

78
import os
89

@@ -31,7 +32,7 @@ async def upload_blob_to_url(
3132
:param data:
3233
The data to upload. This can be bytes, text, an iterable or a file-like object.
3334
:type data: bytes or str or Iterable
34-
:param credential:
35+
:param credential:
3536
The credentials with which to authenticate. This is optional if the
3637
blob URL already has a SAS token. The value can be a SAS token string,
3738
an instance of a AzureSasCredential or AzureNamedKeyCredential from azure.core.credentials,
@@ -40,7 +41,11 @@ async def upload_blob_to_url(
4041
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
4142
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
4243
should be the storage account key.
43-
:type credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, "TokenCredential"]] # pylint: disable=line-too-long
44+
:type credential:
45+
~azure.core.credentials.AzureNamedKeyCredential or
46+
~azure.core.credentials.AzureSasCredential or
47+
~azure.core.credentials.TokenCredential or
48+
str or dict[str, str] or None
4449
:keyword bool overwrite:
4550
Whether the blob to be uploaded should overwrite the current data.
4651
If True, upload_blob_to_url will overwrite any existing data. If set to False, the
@@ -64,7 +69,7 @@ async def upload_blob_to_url(
6469
:keyword str encoding:
6570
Encoding to use if text is supplied as input. Defaults to UTF-8.
6671
:returns: Blob-updated property dict (Etag and last modified)
67-
:rtype: dict(str, Any)
72+
:rtype: dict[str, Any]
6873
"""
6974
async with BlobClient.from_blob_url(blob_url, credential=credential) as client:
7075
return await client.upload_blob(data=data, blob_type=BlobType.BlockBlob, **kwargs)
@@ -99,7 +104,11 @@ async def download_blob_from_url(
99104
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
100105
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
101106
should be the storage account key.
102-
:type credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, "TokenCredential"]] # pylint: disable=line-too-long
107+
:type credential:
108+
~azure.core.credentials.AzureNamedKeyCredential or
109+
~azure.core.credentials.AzureSasCredential or
110+
~azure.core.credentials.TokenCredential or
111+
str or dict[str, str] or None
103112
:keyword bool overwrite:
104113
Whether the local file should be overwritten if it already exists. The default value is
105114
`False` - in which case a ValueError will be raised if the file already exists. If set to

sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_client_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6-
# pylint: disable=too-many-lines, invalid-overridden-method
6+
# pylint: disable=too-many-lines, invalid-overridden-method, docstring-keyword-should-match-keyword-only
77

88
import warnings
99
from functools import partial

sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_service_client_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6-
# pylint: disable=invalid-overridden-method
6+
# pylint: disable=invalid-overridden-method, docstring-keyword-should-match-keyword-only
77

88
import functools
99
import warnings

sdk/storage/azure-storage-blob/azure/storage/blob/aio/_container_client_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6-
# pylint: disable=too-many-lines, invalid-overridden-method
6+
# pylint: disable=too-many-lines, invalid-overridden-method, docstring-keyword-should-match-keyword-only
77

88
import functools
99
import warnings

sdk/storage/azure-storage-blob/azure/storage/blob/aio/_lease_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6-
# pylint: disable=invalid-overridden-method
6+
# pylint: disable=invalid-overridden-method, docstring-keyword-should-match-keyword-only
77

88
from typing import ( # pylint: disable=unused-import
99
Union, Optional, Any, IO, Iterable, AnyStr, Dict, List, Tuple,

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_directory_client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6+
# pylint: disable=docstring-keyword-should-match-keyword-only
7+
68
from typing import (
79
Any, Dict, Optional, Union,
810
TYPE_CHECKING
@@ -53,6 +55,11 @@ class DataLakeDirectoryClient(PathClient):
5355
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
5456
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
5557
should be the storage account key.
58+
:type credential:
59+
~azure.core.credentials.AzureNamedKeyCredential or
60+
~azure.core.credentials.AzureSasCredential or
61+
~azure.core.credentials.TokenCredential or
62+
str or dict[str, str] or None
5663
:keyword str api_version:
5764
The Storage API version to use for requests. Default value is the most recent service version that is
5865
compatible with the current SDK. Setting to an older version may result in reduced feature compatibility.

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6+
# pylint: disable=docstring-keyword-should-match-keyword-only
7+
68
from io import BytesIO
79
from typing import (
810
Any, AnyStr, AsyncIterable, Dict, IO, Iterable, Optional, Union,
@@ -61,6 +63,11 @@ class DataLakeFileClient(PathClient):
6163
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
6264
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
6365
should be the storage account key.
66+
:type credential:
67+
~azure.core.credentials.AzureNamedKeyCredential or
68+
~azure.core.credentials.AzureSasCredential or
69+
~azure.core.credentials.TokenCredential or
70+
str or dict[str, str] or None
6471
:keyword str api_version:
6572
The Storage API version to use for requests. Default value is the most recent service version that is
6673
compatible with the current SDK. Setting to an older version may result in reduced feature compatibility.

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_lease.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6+
# pylint: disable=docstring-keyword-should-match-keyword-only
67

78
import uuid
89

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_service_client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6+
# pylint: disable=docstring-keyword-should-match-keyword-only
7+
68
from typing import Any, Dict, Optional, Union, TYPE_CHECKING
79
from urllib.parse import urlparse
810

@@ -52,6 +54,11 @@ class DataLakeServiceClient(StorageAccountHostsMixin):
5254
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
5355
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
5456
should be the storage account key.
57+
:type credential:
58+
~azure.core.credentials.AzureNamedKeyCredential or
59+
~azure.core.credentials.AzureSasCredential or
60+
~azure.core.credentials.TokenCredential or
61+
str or dict[str, str] or None
5562
:keyword str api_version:
5663
The Storage API version to use for requests. Default value is the most recent service version that is
5764
compatible with the current SDK. Setting to an older version may result in reduced feature compatibility.

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_file_system_client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6-
# pylint: disable=too-many-lines
6+
# pylint: disable=too-many-lines, docstring-keyword-should-match-keyword-only
7+
78
import functools
89
from typing import Any, Dict, Optional, Union, TYPE_CHECKING
910
from urllib.parse import urlparse, quote, unquote
@@ -60,6 +61,11 @@ class FileSystemClient(StorageAccountHostsMixin):
6061
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
6162
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
6263
should be the storage account key.
64+
:type credential:
65+
~azure.core.credentials.AzureNamedKeyCredential or
66+
~azure.core.credentials.AzureSasCredential or
67+
~azure.core.credentials.TokenCredential or
68+
str or dict[str, str] or None
6369
:keyword str api_version:
6470
The Storage API version to use for requests. Default value is the most recent service version that is
6571
compatible with the current SDK. Setting to an older version may result in reduced feature compatibility.

0 commit comments

Comments
 (0)