Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .chronus/changes/python-iterBytes-2026-1-23-17-37-6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: fix
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

allow decompression in version tolerant
2 changes: 1 addition & 1 deletion packages/autorest.python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
"dependencies": {
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTg4OTg4NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.27.1.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTkxNDE1OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.27.1.tgz",
"@autorest/system-requirements": "~1.0.2",
"fs-extra": "~11.2.0",
"tsx": "^4.21.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def _basic_polling_initial(
)
_request.url = self._client.format_url(_request.url)

_decompress = kwargs.pop("decompress", True)
_stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
Expand All @@ -129,7 +130,7 @@ def _basic_polling_initial(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response)

deserialized = response.iter_bytes()
deserialized = response.iter_bytes() if _decompress else response.iter_raw()

if cls:
return cls(pipeline_response, cast(Iterator[bytes], deserialized), {}) # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ async def _basic_polling_initial(
)
_request.url = self._client.format_url(_request.url)

_decompress = kwargs.pop("decompress", True)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
_request, stream=_stream, **kwargs
Expand All @@ -100,7 +101,7 @@ async def _basic_polling_initial(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response)

deserialized = response.iter_bytes()
deserialized = response.iter_bytes() if _decompress else response.iter_raw()

if cls:
return cls(pipeline_response, cast(AsyncIterator[bytes], deserialized), {}) # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1801,6 +1801,7 @@ async def _get_multiple_pages_lro_initial(
)
_request.url = self._client.format_url(_request.url)

_decompress = kwargs.pop("decompress", True)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
Expand All @@ -1816,7 +1817,7 @@ async def _get_multiple_pages_lro_initial(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)

deserialized = response.iter_bytes()
deserialized = response.iter_bytes() if _decompress else response.iter_raw()

if cls:
return cls(pipeline_response, cast(AsyncIterator[bytes], deserialized), {}) # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2252,6 +2252,7 @@ def _get_multiple_pages_lro_initial(
)
_request.url = self._client.format_url(_request.url)

_decompress = kwargs.pop("decompress", True)
_stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
Expand All @@ -2267,7 +2268,7 @@ def _get_multiple_pages_lro_initial(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)

deserialized = response.iter_bytes()
deserialized = response.iter_bytes() if _decompress else response.iter_raw()

if cls:
return cls(pipeline_response, cast(Iterator[bytes], deserialized), {}) # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ async def _update_qnas_initial(
)
_request.url = self._client.format_url(_request.url)

_decompress = kwargs.pop("decompress", True)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
Expand All @@ -278,7 +279,7 @@ async def _update_qnas_initial(
"str", response.headers.get("Operation-Location")
)

deserialized = response.iter_bytes()
deserialized = response.iter_bytes() if _decompress else response.iter_raw()

if cls:
return cls(pipeline_response, cast(AsyncIterator[bytes], deserialized), response_headers) # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ def _update_qnas_initial(
)
_request.url = self._client.format_url(_request.url)

_decompress = kwargs.pop("decompress", True)
_stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
Expand All @@ -345,7 +346,7 @@ def _update_qnas_initial(
"str", response.headers.get("Operation-Location")
)

deserialized = response.iter_bytes()
deserialized = response.iter_bytes() if _decompress else response.iter_raw()

if cls:
return cls(pipeline_response, cast(Iterator[bytes], deserialized), response_headers) # type: ignore
Expand Down
Loading
Loading