-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Suppress deprecation warning when unpacking context in default_event_handler of MSGraphAsyncOperator #47069
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
potiuk
merged 61 commits into
apache:main
from
dabla:fix/avoid-context-deprecation-warnings
Apr 18, 2025
Merged
Suppress deprecation warning when unpacking context in default_event_handler of MSGraphAsyncOperator #47069
potiuk
merged 61 commits into
apache:main
from
dabla:fix/avoid-context-deprecation-warnings
Apr 18, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…arnings when unpacking in default_event_handler method of MSGraphAsyncOperator
…warn(None) to avoid TypeError: exceptions must be derived from Warning, not <class 'NoneType'>
ashb
reviewed
Feb 26, 2025
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/msgraph.py
Outdated
Show resolved
Hide resolved
Contributor
Author
…g raise by Context extends from it
…ster_at_fork' when running test on Windows machine
…ing in execute_callback
…check platform instead and if not windows then register fork
Contributor
Author
|
I think it's ok now |
potiuk
approved these changes
Apr 18, 2025
ellisms
pushed a commit
to ellisms/airflow
that referenced
this pull request
Apr 18, 2025
…handler of MSGraphAsyncOperator (apache#47069) * refactor: Make a copy of context items as dict to avoid deprecation warnings when unpacking in default_event_handler method of MSGraphAsyncOperator * refactor: Updated TestMSGraphAsyncOperator * refactor: Try to ignore the TypeError on warns(None) * refactor: Use warnings.catch_warnings(record=True) instead of pytest.warn(None) to avoid TypeError: exceptions must be derived from Warning, not <class 'NoneType'> * refactor: Don't copy context but suppress warnings message instead * refactor: Forgot to filter deprecation warnings * refactor: Also filter UserWarnings as AirflowContextDeprecationWarning raise by Context extends from it * refactor: Try to make import of AirflowContextDeprecationWarning cross Airflow version compatible * refactor: Added openlineage module to Microsoft Azure provider * refactor: Added microsoft.aure provider in selected-providers-list-as-string for trigger openlineage and related providers tests when Assets files changed * refactor: Added microsoft.aure provider in docs-list-as-string for trigger openlineage and related providers tests when Assets files changed * refactor: Adapted providers-test-types-list-as-strings-in-json * refactor: Added openlineage as optional dependency in provider_info * refactor: Invert import of AirflowContextDeprecationWarning * refactor: Redefine AirflowContextDeprecationWarning if Airflow 3 or higher * Revert "refactor: Added openlineage as optional dependency in provider_info" This reverts commit b8cdad5. * Revert "refactor: Adapted providers-test-types-list-as-strings-in-json" This reverts commit b4dbfc0. * Revert "refactor: Added microsoft.aure provider in docs-list-as-string for trigger openlineage and related providers tests when Assets files changed" This reverts commit a3e6ac6. * Revert "refactor: Added microsoft.aure provider in selected-providers-list-as-string for trigger openlineage and related providers tests when Assets files changed" This reverts commit 32abded. * refactor: Also filter UserWarnings * refactor: Catch AttributeError instead of ImportError * refactor: Try to satisfy mypy regarding AirflowContextDeprecationWarning * refactor: Removed openlineage from README.rst * refactor: Removed openlineage from pyproject.toml * refactor: Handle AirflowContextDeprecationWarning directly within execute_callable method * refactor: Ignore MyPy AttributeError * refactor: Suppress AttributeError: module 'os' has no attribute 'register_at_fork' when running test on Windows machine * refactor: Also suppress ImportError for AirflowContextDeprecationWarning in execute_callback * refactor: Instead of suppressing AttributeError, which is dangerous, check platform instead and if not windows then register fork * refactor: Reorganized imports settings * refactor: Reformatted execute_callback * refactor: Move mypy ignore one line up --------- Co-authored-by: David Blain <david.blain@infrabel.be> Co-authored-by: David Blain <david.blain@b-holding.be>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Suppress deprecation warning when unpacking context in default_event_handler of MSGraphAsyncOperator.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.