Skip to content

Commit 9f46fbb

Browse files
[Storage] Enabled black for azure-storage-blob package (#47048)
1 parent 404aeb5 commit 9f46fbb

143 files changed

Lines changed: 15444 additions & 14357 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore

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

Lines changed: 69 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
AccountSasPermissions,
2525
StorageErrorCode,
2626
UserDelegationKey,
27-
Services
27+
Services,
2828
)
2929
from ._generated.models import RehydratePriority
3030
from ._models import (
@@ -74,8 +74,10 @@
7474
def upload_blob_to_url(
7575
blob_url: str,
7676
data: Union[Iterable[AnyStr], IO[AnyStr]],
77-
credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] = None, # pylint: disable=line-too-long
78-
**kwargs: Any
77+
credential: Optional[
78+
Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]
79+
] = None,
80+
**kwargs: Any,
7981
) -> Dict[str, Any]:
8082
"""Upload data to a given URL
8183
@@ -143,8 +145,10 @@ def _download_to_stream(client: BlobClient, handle: IO[bytes], **kwargs: Any) ->
143145
def download_blob_from_url(
144146
blob_url: str,
145147
output: Union[str, IO[bytes]],
146-
credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] = None, # pylint: disable=line-too-long
147-
**kwargs: Any
148+
credential: Optional[
149+
Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]
150+
] = None,
151+
**kwargs: Any,
148152
) -> None:
149153
"""Download the contents of a blob to a local file or stream.
150154
@@ -193,72 +197,72 @@ def download_blob_from_url(
193197
:return: None
194198
:rtype: None
195199
"""
196-
overwrite = kwargs.pop('overwrite', False)
197-
with BlobClient.from_blob_url(blob_url, credential=credential) as client: # pylint: disable=not-context-manager
198-
if hasattr(output, 'write'):
200+
overwrite = kwargs.pop("overwrite", False)
201+
with BlobClient.from_blob_url(blob_url, credential=credential) as client: # pylint: disable=not-context-manager
202+
if hasattr(output, "write"):
199203
_download_to_stream(client, cast(IO[bytes], output), **kwargs)
200204
else:
201205
if not overwrite and os.path.isfile(output):
202206
raise ValueError(f"The file '{output}' already exists.")
203-
with open(output, 'wb') as file_handle:
207+
with open(output, "wb") as file_handle:
204208
_download_to_stream(client, file_handle, **kwargs)
205209

206210

207211
__all__ = [
208-
'upload_blob_to_url',
209-
'download_blob_from_url',
210-
'BlobServiceClient',
211-
'ContainerClient',
212-
'BlobClient',
213-
'BlobType',
214-
'BlobLeaseClient',
215-
'StorageErrorCode',
216-
'UserDelegationKey',
217-
'ExponentialRetry',
218-
'LinearRetry',
219-
'LocationMode',
220-
'BlockState',
221-
'StandardBlobTier',
222-
'PremiumPageBlobTier',
223-
'SequenceNumberAction',
224-
'BlobImmutabilityPolicyMode',
225-
'ImmutabilityPolicy',
226-
'PublicAccess',
227-
'BlobAnalyticsLogging',
228-
'Metrics',
229-
'RetentionPolicy',
230-
'StaticWebsite',
231-
'CorsRule',
232-
'ContainerProperties',
233-
'BlobProperties',
234-
'BlobPrefix',
235-
'FilteredBlob',
236-
'LeaseProperties',
237-
'ContentSettings',
238-
'CopyProperties',
239-
'BlobBlock',
240-
'PageRange',
241-
'AccessPolicy',
242-
'QuickQueryDialect',
243-
'ContainerSasPermissions',
244-
'BlobSasPermissions',
245-
'ResourceTypes',
246-
'AccountSasPermissions',
247-
'StorageStreamDownloader',
248-
'CustomerProvidedEncryptionKey',
249-
'RehydratePriority',
250-
'generate_account_sas',
251-
'generate_container_sas',
252-
'generate_blob_sas',
253-
'PartialBatchErrorException',
254-
'ContainerEncryptionScope',
255-
'BlobQueryError',
256-
'DelimitedJsonDialect',
257-
'DelimitedTextDialect',
258-
'ArrowDialect',
259-
'ArrowType',
260-
'BlobQueryReader',
261-
'ObjectReplicationPolicy',
262-
'ObjectReplicationRule',
263-
'Services',
212+
"upload_blob_to_url",
213+
"download_blob_from_url",
214+
"BlobServiceClient",
215+
"ContainerClient",
216+
"BlobClient",
217+
"BlobType",
218+
"BlobLeaseClient",
219+
"StorageErrorCode",
220+
"UserDelegationKey",
221+
"ExponentialRetry",
222+
"LinearRetry",
223+
"LocationMode",
224+
"BlockState",
225+
"StandardBlobTier",
226+
"PremiumPageBlobTier",
227+
"SequenceNumberAction",
228+
"BlobImmutabilityPolicyMode",
229+
"ImmutabilityPolicy",
230+
"PublicAccess",
231+
"BlobAnalyticsLogging",
232+
"Metrics",
233+
"RetentionPolicy",
234+
"StaticWebsite",
235+
"CorsRule",
236+
"ContainerProperties",
237+
"BlobProperties",
238+
"BlobPrefix",
239+
"FilteredBlob",
240+
"LeaseProperties",
241+
"ContentSettings",
242+
"CopyProperties",
243+
"BlobBlock",
244+
"PageRange",
245+
"AccessPolicy",
246+
"QuickQueryDialect",
247+
"ContainerSasPermissions",
248+
"BlobSasPermissions",
249+
"ResourceTypes",
250+
"AccountSasPermissions",
251+
"StorageStreamDownloader",
252+
"CustomerProvidedEncryptionKey",
253+
"RehydratePriority",
254+
"generate_account_sas",
255+
"generate_container_sas",
256+
"generate_blob_sas",
257+
"PartialBatchErrorException",
258+
"ContainerEncryptionScope",
259+
"BlobQueryError",
260+
"DelimitedJsonDialect",
261+
"DelimitedTextDialect",
262+
"ArrowDialect",
263+
"ArrowType",
264+
"BlobQueryReader",
265+
"ObjectReplicationPolicy",
266+
"ObjectReplicationRule",
267+
"Services",
264268
]

0 commit comments

Comments
 (0)