-
Notifications
You must be signed in to change notification settings - Fork 3k
[Storage] Change content iterating in _download_async.py
, add decompression live tests against compressed dataset
#39755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ing decompress knob
API change check API changes are not detected in this pull request. |
/azp run python - storage - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -46,8 +46,11 @@ | |||
async def process_content(data: Any, start_offset: int, end_offset: int, encryption: Dict[str, Any]) -> bytes: | |||
if data is None: | |||
raise ValueError("Response cannot be None.") | |||
await data.response.load_body() | |||
content = cast(bytes, data.response.body()) | |||
if not data.response.is_stream_consumed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this exists on old transports... --> therefore may need to do an attribute check instead (but start off with seeing if there is any other way without attribute check)
await data.response.load_body() | ||
content = cast(bytes, data.response.body()) | ||
if not data.response.is_stream_consumed: | ||
content = b"".join([d async for d in data]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good start-- then test against the 3 transports, then when those work test validate_content
response.load_body()
andresponse.body()
in_download_async.py
to access content, as this method does not respect thedecompress
param passed todownload_blob
APIif-else
block was added to handle the general hotpath and thevalidate_content=True
path (where the body would have been loaded previously for MD5 check)decompress=T/F
scenario.