Skip to content

[docs] add new backcompat serialization methods to migration guide #41895

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

Merged
merged 4 commits into from
Jul 10, 2025

Conversation

iscai-msft
Copy link
Contributor

No description provided.

@Copilot Copilot AI review requested due to automatic review settings July 3, 2025 16:36
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds new backcompat serialization helper methods to the Azure Core SDK and updates the migration guide to document their usage.

  • Export three new helper functions in azure.core.serialization for backward compatibility.
  • Introduce code examples in the migration guide showing how to use as_attribute_dict.
  • Document the new helper methods (is_generated_model, attribute_list) in the guide.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
sdk/core/azure-core/azure/core/serialization.py Updated __all__ to export is_generated_model, as_attribute_dict, and attribute_list
doc/dev/mgmt/hybrid_model_migration.md Added backcompat code samples and a section for additional helper methods
Comments suppressed due to low confidence (3)

doc/dev/mgmt/hybrid_model_migration.md:277

  • The Additional Helper Methods section lists is_generated_model and attribute_list but omits as_attribute_dict. Consider adding a documentation entry for as_attribute_dict to provide a complete overview of helper methods.
For edge cases and generic code that works with models, Azure Core provides these utility methods in `azure.core.serialization`:

sdk/core/azure-core/azure/core/serialization.py:14

  • [nitpick] Add unit tests covering the new serialization helper methods (as_attribute_dict, is_generated_model, attribute_list) to ensure their behavior is validated across different model scenarios.
__all__ = ["NULL", "AzureJSONEncoder", "is_generated_model", "as_attribute_dict", "attribute_list"]

sdk/core/azure-core/azure/core/serialization.py:14

  • The newly added names in all are not defined or imported in this module, which will cause a NameError. Ensure that is_generated_model, as_attribute_dict, and attribute_list are implemented or imported before exporting them.
__all__ = ["NULL", "AzureJSONEncoder", "is_generated_model", "as_attribute_dict", "attribute_list"]

Copy link
Member

@pvaneck pvaneck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted some inline suggestions about the minimum core version needed for the backcompat functions.

iscai-msft and others added 2 commits July 10, 2025 13:30
Co-authored-by: Paul Van Eck <paulvaneck@microsoft.com>
@iscai-msft iscai-msft requested a review from pvaneck July 10, 2025 17:31
@iscai-msft iscai-msft enabled auto-merge (squash) July 10, 2025 17:31
@iscai-msft iscai-msft merged commit 526285d into Azure:main Jul 10, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants