-
Notifications
You must be signed in to change notification settings - Fork 3.2k
add "azure-asyncoperation" header into mgmt-core #44658
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR adds support for the azure-asyncoperation header in ARM polling continuation tokens by overriding the _filter_headers_for_continuation_token method in both ARMPolling and AsyncARMPolling classes. The changes update the minimum azure-core version to 1.38.0 to use the new continuation token infrastructure.
Changes:
- Updated azure-core dependency from >=1.32.0 to >=1.38.0
- Added
_filter_headers_for_continuation_tokenoverride inARMPollingandAsyncARMPollingclasses - Created new
_utils.pymodule with_filter_arm_headersfunction
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/core/azure-mgmt-core/setup.py | Bumped azure-core minimum version to 1.38.0 to support new continuation token format |
| sdk/core/azure-mgmt-core/azure/mgmt/core/polling/arm_polling.py | Added _filter_headers_for_continuation_token override and imported _filter_arm_headers utility |
| sdk/core/azure-mgmt-core/azure/mgmt/core/polling/async_arm_polling.py | Added _filter_headers_for_continuation_token override for async polling |
| sdk/core/azure-mgmt-core/azure/mgmt/core/polling/_utils.py | Created new utility module with ARM-specific header filtering logic |
| sdk/core/azure-mgmt-core/CHANGELOG.md | Added changelog entry documenting the bug fix |
| :type headers: Mapping[str, str] | ||
| :return: A filtered dictionary of headers to include in the continuation token. | ||
| :rtype: dict[str, str] | ||
| """ |
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.
What do you think about calling the parent class _filter_headers_for_continuation_token here and starting from that in order to avoid importing internal objects (_LRO_HEADERS)? Then _ARM_LRO_HEADERS can just be ARM-specific headers (i.e. _ARM_LRO_HEADERS = frozenset(["azure-asyncoperation"]). No internal module imports needed. For example, something akin to:
filtered = super()._filter_headers_for_continuation_token()
filtered.update({header: headers[header] for header in _ARM_LRO_HEADERS if header in headers})
return filtered
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