Skip to content

Commit 9e5c2e0

Browse files
[Storage] [Queue] Fixed next pylint errors in queue storage (#34954)
* [Storage] [Queue] Fixed next pylint errors in queue storage * Worked in progress: pylint fixes * Lowercased built-in types, reformatted long types
1 parent a8ac4e5 commit 9e5c2e0

File tree

8 files changed

+23
-15
lines changed

8 files changed

+23
-15
lines changed

sdk/storage/azure-storage-queue/azure/storage/queue/_encryption.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ def decrypt_blob( # pylint: disable=too-many-locals,too-many-statements
859859
:param key_resolver:
860860
The user-provided key resolver. Uses the kid string to return a key-encryption-key
861861
implementing the interface defined above.
862-
:paramtype key_resolver: Optional[Callable[[str], KeyEncryptionKey]]
862+
:type key_resolver: Optional[Callable[[str], KeyEncryptionKey]]
863863
:param bytes content:
864864
The encrypted blob content.
865865
:param int start_offset:

sdk/storage/azure-storage-queue/azure/storage/queue/_queue_client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ def from_queue_url(
130130
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
131131
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
132132
should be the storage account key.
133-
:paramtype credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, "TokenCredential"]] # pylint: disable=line-too-long
133+
:type credential:
134+
Optional[Union[str, dict[str, str], AzureNamedKeyCredential, AzureSasCredential, "TokenCredential"]]
134135
:keyword str audience: The audience to use when requesting tokens for Azure Active Directory
135136
authentication. Only has an effect when credential is of type TokenCredential. The value could be
136137
https://storage.azure.com/ (default) or https://<account>.queue.core.windows.net.
@@ -162,7 +163,8 @@ def from_connection_string(
162163
Credentials provided here will take precedence over those in the connection string.
163164
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
164165
should be the storage account key.
165-
:paramtype credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, "TokenCredential"]] # pylint: disable=line-too-long
166+
:type credential:
167+
Optional[Union[str, dict[str, str], AzureNamedKeyCredential, AzureSasCredential, "TokenCredential"]]
166168
:keyword str audience: The audience to use when requesting tokens for Azure Active Directory
167169
authentication. Only has an effect when credential is of type TokenCredential. The value could be
168170
https://storage.azure.com/ (default) or https://<account>.queue.core.windows.net.
@@ -852,7 +854,7 @@ def peek_messages(
852854
A list of :class:`~azure.storage.queue.QueueMessage` objects. Note that
853855
next_visible_on and pop_receipt will not be populated as peek does
854856
not pop the message and can only retrieve already visible messages.
855-
:rtype: list(:class:`~azure.storage.queue.QueueMessage`)
857+
:rtype: list[~azure.storage.queue.QueueMessage]
856858
857859
.. admonition:: Example:
858860

sdk/storage/azure-storage-queue/azure/storage/queue/_queue_client_helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def _parse_url(
3232
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
3333
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
3434
should be the storage account key.
35-
:paramtype credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, AsyncTokenCredential, TokenCredential]] # pylint: disable=line-too-long
35+
:type credential:
36+
Optional[Union[str, dict[str, str], AzureNamedKeyCredential, AzureSasCredential, AsyncTokenCredential, TokenCredential]] # pylint: disable=line-too-long
3637
:returns: The parsed URL and SAS token.
3738
:rtype: Tuple[ParseResult, Any]
3839
"""

sdk/storage/azure-storage-queue/azure/storage/queue/_queue_service_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ def from_connection_string(
130130
Credentials provided here will take precedence over those in the connection string.
131131
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
132132
should be the storage account key.
133-
:paramtype credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, "TokenCredential"]] # pylint: disable=line-too-long
133+
:type credential:
134+
Optional[Union[str, dict[str, str], AzureNamedKeyCredential, AzureSasCredential, "TokenCredential"]]
134135
:keyword str audience: The audience to use when requesting tokens for Azure Active Directory
135136
authentication. Only has an effect when credential is of type TokenCredential. The value could be
136137
https://storage.azure.com/ (default) or https://<account>.queue.core.windows.net.

sdk/storage/azure-storage-queue/azure/storage/queue/_queue_service_client_helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def _parse_url(
3030
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
3131
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
3232
should be the storage account key.
33-
:paramtype credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, AsyncTokenCredential, TokenCredential]] # pylint: disable=line-too-long
33+
:type credential:
34+
Optional[Union[str, dict[str, str], AzureNamedKeyCredential, AzureSasCredential, AsyncTokenCredential, TokenCredential]] # pylint: disable=line-too-long
3435
:returns: The parsed URL and SAS token.
3536
:rtype: Tuple[ParseResult, Any]
3637
"""

sdk/storage/azure-storage-queue/azure/storage/queue/_shared/policies.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,11 @@ def increment(
477477
) -> bool:
478478
"""Increment the retry counters.
479479
480-
Dict[str, Any]] settings: The configurable values pertaining to the increment operation.
480+
:param dict[str, Any] settings: The configurable values pertaining to the increment operation.
481481
:param PipelineRequest request: A pipeline request object.
482482
:param Optional[PipelineResponse] response: A pipeline response object.
483-
:param error: An error encountered during the request, or
483+
:param Optional[AzureError] error: An error encountered during the request, or
484484
None if the response was received successfully.
485-
:paramtype error: Optional[AzureError]
486485
:returns: Whether the retry attempts are exhausted.
487486
:rtype: bool
488487
"""

sdk/storage/azure-storage-queue/azure/storage/queue/aio/_queue_client_async.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ class QueueClient(AsyncStorageAccountHostsMixin, StorageAccountHostsMixin, Stora
5959
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
6060
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
6161
should be the storage account key.
62-
:paramtype credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, AsyncTokenCredential]] # pylint: disable=line-too-long
62+
:type credential:
63+
Optional[Union[str, dict[str, str], AzureNamedKeyCredential, AzureSasCredential, AsyncTokenCredential]]
6364
:keyword str api_version:
6465
The Storage API version to use for requests. Default value is the most recent service version that is
6566
compatible with the current SDK. Setting to an older version may result in reduced feature compatibility.
@@ -144,7 +145,8 @@ def from_queue_url(
144145
- except in the case of AzureSasCredential, where the conflicting SAS tokens will raise a ValueError.
145146
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
146147
should be the storage account key.
147-
:paramtype credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, AsyncTokenCredential]] # pylint: disable=line-too-long
148+
:type credential:
149+
Optional[Union[str, dict[str, str], AzureNamedKeyCredential, AzureSasCredential, AsyncTokenCredential]]
148150
:keyword str audience: The audience to use when requesting tokens for Azure Active Directory
149151
authentication. Only has an effect when credential is of type TokenCredential. The value could be
150152
https://storage.azure.com/ (default) or https://<account>.queue.core.windows.net.
@@ -176,7 +178,8 @@ def from_connection_string(
176178
Credentials provided here will take precedence over those in the connection string.
177179
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
178180
should be the storage account key.
179-
:paramtype credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, AsyncTokenCredential]] # pylint: disable=line-too-long
181+
:type credential:
182+
Optional[Union[str, dict[str, str], AzureNamedKeyCredential, AzureSasCredential, AsyncTokenCredential]]
180183
:keyword str audience: The audience to use when requesting tokens for Azure Active Directory
181184
authentication. Only has an effect when credential is of type TokenCredential. The value could be
182185
https://storage.azure.com/ (default) or https://<account>.queue.core.windows.net.
@@ -851,7 +854,7 @@ async def peek_messages(
851854
A list of :class:`~azure.storage.queue.QueueMessage` objects. Note that
852855
next_visible_on and pop_receipt will not be populated as peek does
853856
not pop the message and can only retrieve already visible messages.
854-
:rtype: list(:class:`~azure.storage.queue.QueueMessage`)
857+
:rtype: list[~azure.storage.queue.QueueMessage]
855858
856859
.. admonition:: Example:
857860

sdk/storage/azure-storage-queue/azure/storage/queue/aio/_queue_service_client_async.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ def from_connection_string(
129129
Credentials provided here will take precedence over those in the connection string.
130130
If using an instance of AzureNamedKeyCredential, "name" should be the storage account name, and "key"
131131
should be the storage account key.
132-
:paramtype credential: Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, AsyncTokenCredential]] # pylint: disable=line-too-long
132+
:type credential:
133+
Optional[Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, AsyncTokenCredential]]
133134
:returns: A Queue service client.
134135
:rtype: ~azure.storage.queue.QueueClient
135136

0 commit comments

Comments
 (0)