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

Enable "airflow tasks test" to run deferrable operator #37542

Merged

Conversation

Lee-W
Copy link
Member

@Lee-W Lee-W commented Feb 19, 2024

Why

Currently, airflow tasks test [DAG] [TASK] cannot test tasks in deferrable mode; it just ends when TaskDeferred is raised.

What

This PR adds the functionality to run inline triggerer when if TaskDeferred is raised when running airflow tasks test [DAG] [TASK]


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

@Lee-W Lee-W force-pushed the airflow-task-cli-to-test-deferrable-op branch 2 times, most recently from ab1885f to 93beff5 Compare February 20, 2024 07:40
@Lee-W Lee-W changed the title feat(cli): enable "airflow tasks test" to run deferrable operator Enable "airflow tasks test" to run deferrable operator Feb 20, 2024
@Lee-W Lee-W marked this pull request as ready for review February 20, 2024 07:48
@Lee-W Lee-W force-pushed the airflow-task-cli-to-test-deferrable-op branch 2 times, most recently from f9f0910 to f281aef Compare February 20, 2024 09:59
@uranusjr
Copy link
Member

We should probably rename the two underscore-leading names, otherwise lgtm.

@Lee-W
Copy link
Member Author

Lee-W commented Feb 20, 2024

We should probably rename the two underscore-leading names, otherwise lgtm.

Do you mean _run_trigger and maybe _run_raw_task?

@uranusjr
Copy link
Member

Yes

@Lee-W
Copy link
Member Author

Lee-W commented Feb 20, 2024

I renamed _run_trigger as _run_inline_triggere to align the term used here as for _run_raw_task, it seems we use it in a lot of places. not sure whether we should change it 🤔 What I'm thinking of is just changing it to _run_task. Do you have anything in mind?

@Lee-W Lee-W force-pushed the airflow-task-cli-to-test-deferrable-op branch 2 times, most recently from 1960930 to 853f537 Compare February 21, 2024 00:12
Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, the potential name change suggestion is not binding.

@Lee-W Lee-W force-pushed the airflow-task-cli-to-test-deferrable-op branch from 853f537 to 7b55586 Compare February 21, 2024 07:44
@kaxil kaxil added this to the Airflow 2.9.0 milestone Feb 21, 2024
@phanikumv phanikumv merged commit 7d3b5b4 into apache:main Feb 21, 2024
59 checks passed
@phanikumv phanikumv deleted the airflow-task-cli-to-test-deferrable-op branch February 21, 2024 08:19
@ephraimbuddy ephraimbuddy added the type:improvement Changelog: Improvements label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:CLI type:improvement Changelog: Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants