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 its context is null. One possible solution is to use pipeline_response.http_response which works both for sync and async.
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:
version-tolerant and legacy use different HttpResponse type
fixes https://github.com/Azure/autorest.python/issues/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: