-
Notifications
You must be signed in to change notification settings - Fork 58
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
Fix deserialization error for LRO which has discriminator #2589
Conversation
...e/generated/azure-core-lro-standard/specs/azure/core/lro/standard/_operations/_operations.py
Outdated
Show resolved
Hide resolved
91a6cac
to
3c22f8e
Compare
...api/generated/azure/multiapi/sample/v1/aio/operations/_multiapi_service_client_operations.py
Outdated
Show resolved
Hide resolved
...api/generated/azure/multiapi/sample/v1/aio/operations/_multiapi_service_client_operations.py
Outdated
Show resolved
Hide resolved
...api/generated/azure/multiapi/sample/v1/aio/operations/_multiapi_service_client_operations.py
Outdated
Show resolved
Hide resolved
...api/generated/azure/multiapi/sample/v1/aio/operations/_multiapi_service_client_operations.py
Outdated
Show resolved
Hide resolved
…deserialization-fix
…st.python into deserialization-fix
f" {async_await} response.read() # Load the body in memory and close the socket", | ||
] | ||
) | ||
response_read = f" {async_await}response.read() # Load the body in memory and close the socket" |
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.
we can always call read, regardless of stream or not
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.
It is very strange to judge _stream when its value is True
, so I think it is better to keep the logic.
…deserialization-fix
…deserialization-fix
move to #2628 |
fixes #2428
There are some new findings for legacy test when I mark initial operation as stream operation:
When LRO succeeds in first call, if will fail if use
pipeline_response
to deserialize since itscontext
is null. One possible solution is to usepipeline_response.http_response
which works both for sync and async.When LRO needs poll, azure-core will set stream=false by default for poll request, so lro works as before.
for async initial, we need call

response.load_body()
for normal response otherwise the following error happens:for async initial, we need call
response.load_body()
for error response otherwise the following error happens for test case test_sads_put_non_retry. However sync needn't: