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
Add on_skipped_callback
in to BaseOperator
#36374
Conversation
fc549c5
to
ed4a5ea
Compare
on_skipped_callback
to BaseOperator
on_skipped_callback
to BaseOperator
on_skipped_callback
on_skipped_callback
on_skipped_callback
in to BaseOperator
299694a
to
c48cf68
Compare
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.
The trigger rule dep could change the TI state to skipped without raising this exception, I wonder if we should handle that case too 🤔
changed = ti.set_state(new_state, session) |
I'm not sure if we handle that for other callbacks
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.
I have seen a scenario where the skipped state is set when branching doesn't follow some of the downstream tasks. Looks like that's not covered.
I'm not sure if we can/should handle it. The goal here is to handle the case when the task is executed and then status changed to skipped due to raise of skip exception. It is not meant to be used with cascading status to downstream tasks (though maybe it's something we should think about). However for the scope of this PR I think we should clarify in docs about this unique case. |
777ff5b
to
8093aaa
Compare
As @eladkal commented, I think it should take care by another PR that call the |
35755d3
to
468eec6
Compare
468eec6
to
fc51328
Compare
The mentioned issue mentions #30264 as a potential use case, but this PR will not close it, because the running tasks are marked as skipped without raising any skip exception: airflow/airflow/jobs/scheduler_job_runner.py Lines 1449 to 1464 in c7e1306
So IMHO, if you want to split implementing the callback on different PRs, you need to update the description by replacing: closes: #35936 by related: #35936 of course, with clarifying that in the doc as @eladkal suggested. |
That was my edit to the description. If you are OK with it I think we can keep it as close and open a new issue that aim to solve the 2nd use case. Its just easier to track when issue has single well defined task. |
I just updated the description to "related: #35936" instead of |
docs/apache-airflow/administration-and-deployment/logging-monitoring/callbacks.rst
Show resolved
Hide resolved
Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com>
Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com>
f7a802e
to
ebfd1fe
Compare
--------- Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com>
related: #35936
^ 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.