Skip to content

Commit

Permalink
[Storage] Document deprecated methods on StorageStreamDownloader (#28867
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jalauzon-msft authored Feb 16, 2023
1 parent 18b1e38 commit 5340f38
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 11 deletions.
12 changes: 9 additions & 3 deletions sdk/storage/azure-storage-blob/azure/storage/blob/_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,10 +662,12 @@ def readall(self) -> T:
return data

def content_as_bytes(self, max_concurrency=1):
"""Download the contents of this file.
"""DEPRECATED: Download the contents of this file.
This operation is blocking until all data is downloaded.
This method is deprecated, use func:`readall` instead.
:keyword int max_concurrency:
The number of parallel connections with which to download.
:rtype: bytes
Expand All @@ -678,10 +680,12 @@ def content_as_bytes(self, max_concurrency=1):
return self.readall()

def content_as_text(self, max_concurrency=1, encoding="UTF-8"):
"""Download the contents of this blob, and decode as text.
"""DEPRECATED: Download the contents of this blob, and decode as text.
This operation is blocking until all data is downloaded.
This method is deprecated, use func:`readall` instead.
:keyword int max_concurrency:
The number of parallel connections with which to download.
:param str encoding:
Expand Down Expand Up @@ -773,7 +777,9 @@ def readinto(self, stream: IO[T]) -> int:
return remaining_size

def download_to_stream(self, stream, max_concurrency=1):
"""Download the contents of this blob to a stream.
"""DEPRECATED: Download the contents of this blob to a stream.
This method is deprecated, use func:`readinto` instead.
:param stream:
The stream to download to. This can be an open file-handle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,10 +568,12 @@ async def readall(self) -> T:
return data

async def content_as_bytes(self, max_concurrency=1):
"""Download the contents of this file.
"""DEPRECATED: Download the contents of this file.
This operation is blocking until all data is downloaded.
This method is deprecated, use func:`readall` instead.
:keyword int max_concurrency:
The number of parallel connections with which to download.
:rtype: bytes
Expand All @@ -584,10 +586,12 @@ async def content_as_bytes(self, max_concurrency=1):
return await self.readall()

async def content_as_text(self, max_concurrency=1, encoding="UTF-8"):
"""Download the contents of this blob, and decode as text.
"""DEPRECATED: Download the contents of this blob, and decode as text.
This operation is blocking until all data is downloaded.
This method is deprecated, use func:`readall` instead.
:param int max_concurrency:
The number of parallel connections with which to download.
:param str encoding:
Expand Down Expand Up @@ -698,7 +702,9 @@ async def readinto(self, stream: IO[T]) -> int:
return remaining_size

async def download_to_stream(self, stream, max_concurrency=1):
"""Download the contents of this blob to a stream.
"""DEPRECATED: Download the contents of this blob to a stream.
This method is deprecated, use func:`readinto` instead.
:param stream:
The stream to download to. This can be an open file-handle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,12 @@ def readall(self):
return data

def content_as_bytes(self, max_concurrency=1):
"""Download the contents of this file.
"""DEPRECATED: Download the contents of this file.
This operation is blocking until all data is downloaded.
This method is deprecated, use func:`readall` instead.
:keyword int max_concurrency:
The number of parallel connections with which to download.
:rtype: bytes
Expand All @@ -414,10 +416,12 @@ def content_as_bytes(self, max_concurrency=1):
return self.readall()

def content_as_text(self, max_concurrency=1, encoding="UTF-8"):
"""Download the contents of this file, and decode as text.
"""DEPRECATED: Download the contents of this file, and decode as text.
This operation is blocking until all data is downloaded.
This method is deprecated, use func:`readall` instead.
:keyword int max_concurrency:
The number of parallel connections with which to download.
:param str encoding:
Expand Down Expand Up @@ -495,7 +499,9 @@ def readinto(self, stream):
return self.size

def download_to_stream(self, stream, max_concurrency=1):
"""Download the contents of this file to a stream.
"""DEPRECATED: Download the contents of this file to a stream.
This method is deprecated, use func:`readinto` instead.
:param stream:
The stream to download to. This can be an open file-handle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,12 @@ async def readall(self):
return data

async def content_as_bytes(self, max_concurrency=1):
"""Download the contents of this file.
"""DEPRECATED: Download the contents of this file.
This operation is blocking until all data is downloaded.
This method is deprecated, use func:`readall` instead.
:keyword int max_concurrency:
The number of parallel connections with which to download.
:rtype: bytes
Expand All @@ -366,10 +368,12 @@ async def content_as_bytes(self, max_concurrency=1):
return await self.readall()

async def content_as_text(self, max_concurrency=1, encoding="UTF-8"):
"""Download the contents of this file, and decode as text.
"""DEPRECATED: Download the contents of this file, and decode as text.
This operation is blocking until all data is downloaded.
This method is deprecated, use func:`readall` instead.
:keyword int max_concurrency:
The number of parallel connections with which to download.
:param str encoding:
Expand Down Expand Up @@ -458,6 +462,8 @@ async def readinto(self, stream):
async def download_to_stream(self, stream, max_concurrency=1):
"""Download the contents of this file to a stream.
This method is deprecated, use func:`readinto` instead.
:param stream:
The stream to download to. This can be an open file-handle,
or any writable stream. The stream must be seekable if the download
Expand Down

0 comments on commit 5340f38

Please sign in to comment.