-
Notifications
You must be signed in to change notification settings - Fork 57
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 subtype #2430
base: main
Are you sure you want to change the base?
Conversation
After discussion, we need more test for the fix to confirm it pass all scenarios |
self.assertEqual(animal.name, "Didier") | ||
|
||
# deserialize must not change original data | ||
self.assertEqual(message["dType"], "Animal") | ||
|
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.
I made a complicated test which contains nested polymorphic however autorest.python can't handle that scenario and I already created #2804 to track. Now that no users report similar issue, we don't need to consider that complicated scenarios.
For simple scenarios, changing pop
to get
has no influence for deserialization so I think it is ok to review now.
@msyyc have you been able to run this change through the pipeline that you created to test current sdks? |
SDK regeneration pipeline is mainly for typespec-python since it only regenerates for package which contains |
@msyyc could you try with azure.search.documents from the original ask: Azure/azure-sdk-for-python#37024. |
Already added in test case. |
fixes #2799
.pop
logic is introduced in https://github.com/Azure/msrest-for-python/pull/12/files#diff-c75745c963d37c430993b85e7d95b87db2c0baa4b284389fc839d8fb7d3fdfe1 while I don't find any context why it is needed to remove the polymorphic key