Skip to content

Conversation

@dabla
Copy link
Contributor

@dabla dabla commented Feb 25, 2025

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.rst or {issue_number}.significant.rst, in newsfragments.

…arnings when unpacking in default_event_handler method of MSGraphAsyncOperator
@boring-cyborg boring-cyborg bot added the provider:microsoft-azure Azure-related issues label Feb 25, 2025
@dabla dabla marked this pull request as draft February 25, 2025 17:09
@dabla dabla marked this pull request as ready for review February 26, 2025 14:18
@dabla dabla changed the title Copy context as dict to avoid deprecation warning in default_event_handler of MSGraphAsyncOperator Suppress deprecation warning when unpacking context in default_event_handler of MSGraphAsyncOperator Mar 26, 2025
@dabla
Copy link
Contributor Author

dabla commented Mar 26, 2025

@ashb @potiuk Now I suppress the warnings instead of copying the Context as suggested.

@dabla dabla requested review from ashb and potiuk March 31, 2025 11:22
@ashb ashb removed their request for review April 4, 2025 13:12
@dabla dabla marked this pull request as ready for review April 5, 2025 07:18
@dabla dabla requested a review from ashb April 7, 2025 08:51
@dabla
Copy link
Contributor Author

dabla commented Apr 7, 2025

I think it's ok now

@potiuk potiuk merged commit 82f07ca into apache:main Apr 18, 2025
66 checks passed
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

Labels

provider:microsoft-azure Azure-related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants