Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates azure-ai-translation-text for the v2 GA release, including moving to the stable Translator API version and aligning the package surface area (models, enums, client initialization, and test recordings) with the GA contract.
Changes:
- Promote the package to 2.0.0 GA and switch defaults to api-version
2026-06-06. - Update the public model surface (remove
grade, addTranslationTone/TranslationGenderenums and types). - Simplify client construction/auth plumbing and adjust tests/recording matching to be resilient across api-version changes.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/translation/azure-ai-translation-text/tsp-location.yaml | Bumps the TypeSpec/spec commit reference used for generation. |
| sdk/translation/azure-ai-translation-text/tests/conftest.py | Adjusts test-proxy request matching to ignore api-version. |
| sdk/translation/azure-ai-translation-text/pyproject.toml | Moves classifier to Stable and bumps azure-core minimum. |
| sdk/translation/azure-ai-translation-text/azure/ai/translation/text/models/_models.py | Updates docstrings/types; removes grade; adds tone/gender typing. |
| sdk/translation/azure-ai-translation-text/azure/ai/translation/text/models/_enums.py | Adds TranslationTone and TranslationGender enums. |
| sdk/translation/azure-ai-translation-text/azure/ai/translation/text/models/init.py | Exports newly added enums. |
| sdk/translation/azure-ai-translation-text/azure/ai/translation/text/_patch.py | Refactors sync convenience client to new init/auth/header policy approach. |
| sdk/translation/azure-ai-translation-text/azure/ai/translation/text/aio/_patch.py | Refactors async convenience client similarly. |
| sdk/translation/azure-ai-translation-text/azure/ai/translation/text/_configuration.py | Adds credential to config and infers auth policy when present. |
| sdk/translation/azure-ai-translation-text/azure/ai/translation/text/aio/_configuration.py | Async counterpart of config/auth inference changes. |
| sdk/translation/azure-ai-translation-text/azure/ai/translation/text/_client.py | Generated sync client now accepts credential and passes into configuration. |
| sdk/translation/azure-ai-translation-text/azure/ai/translation/text/aio/_client.py | Generated async client now accepts credential similarly. |
| sdk/translation/azure-ai-translation-text/azure/ai/translation/text/_operations/_operations.py | Updates default api-version and stream handling (decompress / iter_raw). |
| sdk/translation/azure-ai-translation-text/azure/ai/translation/text/aio/_operations/_operations.py | Async operations: same api-version + streaming adjustments. |
| sdk/translation/azure-ai-translation-text/azure/ai/translation/text/_utils/serialization.py | Removes eval usage for basic types; explicit conversions. |
| sdk/translation/azure-ai-translation-text/azure/ai/translation/text/_utils/model_base.py | Enhances (de)serialization behaviors and mutable deserialization caching. |
| sdk/translation/azure-ai-translation-text/apiview-properties.json | Adds APIView namespace mappings for the new enums. |
| sdk/translation/azure-ai-translation-text/_metadata.json | Updates metadata to stable api-version and adds apiVersions map. |
| sdk/translation/azure-ai-translation-text/azure/ai/translation/text/_version.py | Bumps package version from 2.0.0b1 to 2.0.0. |
| sdk/translation/azure-ai-translation-text/CHANGELOG.md | Adds 2.0.0 GA entry and documents breaking change/removals. |
| def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: | ||
| return ( | ||
| isinstance(deserializer, functools.partial) | ||
| and isinstance(deserializer.args[0], functools.partial) | ||
| and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable | ||
| ) |
There was a problem hiding this comment.
_is_array_encoded_deserializer appears to never match the deserializer produced by get_deserializer for array-encoded strings. get_deserializer returns functools.partial(_deserialize_array_encoded, <delimiter>) (whose first arg is a str), but _is_array_encoded_deserializer checks that deserializer.args[0] is itself a functools.partial, so the encoded-string path in _deserialize_sequence won’t trigger and string inputs may be incorrectly treated as iterables. Consider changing the detection to check getattr(deserializer, "func", None) is _deserialize_array_encoded (and likewise for the union case).
Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines