Skip to content
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

Refactor result_processor and event_handler signatures in MSGraphAsyncOperator #46637

Merged
merged 38 commits into from
Feb 19, 2025

Conversation

dabla
Copy link
Contributor

@dabla dabla commented Feb 11, 2025

This PR refactors the result_processor and event_handler signatures in MSGraphAsyncOperator so that the context parameter is always the latest parameter and acts like a kwargs, just like all other Airflow operators do like for example with the PythonOperator. The old signatures are still supported but will log a warning.


^ 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.

@boring-cyborg boring-cyborg bot added the provider:microsoft-azure Azure-related issues label Feb 11, 2025
@dabla dabla marked this pull request as draft February 11, 2025 11:05
David Blain and others added 26 commits February 11, 2025 12:12
…nd make copy of context before expanding to avoid deprecation warnings
@dabla dabla marked this pull request as ready for review February 18, 2025 09:20
@eladkal eladkal merged commit 4833b53 into apache:main Feb 19, 2025
61 checks passed
ntr pushed a commit to ntr/airflow that referenced this pull request Feb 20, 2025
…cOperator (apache#46637)

* refactor: Refactor result_processor and event_handler signatures so that context is the last parameter

* refactor: Reformatted TestMSGraphAsyncOperator

* refactor: Ignore types

* refactor: Ignore types

* refactor: Changed types xcom helper methods

* refactor: Fixed MSGraphSensor

* refactor: Fixed TestMSGraphSensor

* refactor: Changed type pull_xcom

* refactor: Removed white line

* refactor: Reduced timeout of sensor in tests to 5 seconds

* refactor: Extracted common execute_callback method for the handlers and make copy of context before expanding to avoid deprecation warnings

* refactor: Changed types of execute_callable

* refactor: Changed func parameter type of execute_callable

* refactor: Added test for execute_callable

* refactor: Changed func type for execute_callable as it still fails

* refactor: Added test for request_information with custom host in TestKiotaRequestAdapterHook

* refactor: Ignore types in execute_callable

* refactor: Reformatted test_request_information_with_custom_host

* refactor: Reformatted test_execute_callable

* refactor: Context should not be in type checking block

* refactor: Ignore type event_handler

* refactor: Context should be type checked just like in main

* refactor: Fixed TestMSGraphAsyncOperator

---------

Co-authored-by: David Blain <[email protected]>
Co-authored-by: David Blain <[email protected]>
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.

3 participants