Skip to content

Commit 7291148

Browse files
[Storage] [Named Keywords] Blob Package (#41726)
1 parent 53c705d commit 7291148

17 files changed

+2913
-74
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ def upload_blob_to_url(
125125
:return: Blob-updated property dict (Etag and last modified)
126126
:rtype: dict(str, Any)
127127
"""
128-
with BlobClient.from_blob_url(blob_url, credential=credential) as client:
129-
return cast(BlobClient, client).upload_blob(data=data, blob_type=BlobType.BLOCKBLOB, **kwargs)
128+
with BlobClient.from_blob_url(blob_url, credential=credential) as client: # pylint: disable=not-context-manager
129+
return client.upload_blob(data=data, blob_type=BlobType.BLOCKBLOB, **kwargs)
130130

131131

132132
def _download_to_stream(client: BlobClient, handle: IO[bytes], **kwargs: Any) -> None:
@@ -194,7 +194,7 @@ def download_blob_from_url(
194194
:rtype: None
195195
"""
196196
overwrite = kwargs.pop('overwrite', False)
197-
with BlobClient.from_blob_url(blob_url, credential=credential) as client:
197+
with BlobClient.from_blob_url(blob_url, credential=credential) as client: # pylint: disable=not-context-manager
198198
if hasattr(output, 'write'):
199199
_download_to_stream(client, cast(IO[bytes], output), **kwargs)
200200
else:

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

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from datetime import datetime
1010
from functools import partial
1111
from typing import (
12-
Any, AnyStr, cast, Dict, IO, Iterable, List, Optional, overload, Tuple, Union,
12+
Any, AnyStr, cast, Dict, IO, Iterable, List, Optional, Tuple, Union,
1313
TYPE_CHECKING
1414
)
1515
from typing_extensions import Self
@@ -633,26 +633,6 @@ def upload_blob(
633633
return upload_page_blob(**options)
634634
return upload_append_blob(**options)
635635

636-
@overload
637-
def download_blob(
638-
self, offset: Optional[int] = None,
639-
length: Optional[int] = None,
640-
*,
641-
encoding: str,
642-
**kwargs: Any
643-
) -> StorageStreamDownloader[str]:
644-
...
645-
646-
@overload
647-
def download_blob(
648-
self, offset: Optional[int] = None,
649-
length: Optional[int] = None,
650-
*,
651-
encoding: None = None,
652-
**kwargs: Any
653-
) -> StorageStreamDownloader[bytes]:
654-
...
655-
656636
@distributed_trace
657637
def download_blob(
658638
self, offset: Optional[int] = None,

0 commit comments

Comments
 (0)