Repository navigation
Add on_success_succeed_dagrun option to teardown tasks - #74916
Open
kadubhumika wants to merge 5 commits into
Open
kadubhumika wants to merge 5 commits into
kadubhumika wants to merge 5 commits into
Conversation
kadubhumika
requested review from
XD-DENG,
amoghrajesh,
ashb,
bolkedebruin and
shahar1
as code owners
October 17, 2026 10:12
1 of 2 tasks
shahar1
previously requested changes
Oct 17, 2026
shahar1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for your contribution! I'd like to ask for the following:
- Add AI disclosure to the PR's body.
- Undo unrelated Dataproc commits
- Add documentation for using the new feature (
howto/setup-and-teardown.rst) - Add tests to task-sdk
- Fix the static checks
- Fix the title according to the guidelines
kadubhumika
force-pushed
the
feature/on-success-succeed-dagrun
branch
from
October 17, 2026 11:30
6282a07 to
13d7f7f
Compare
Contributor
Author
|
Thank You ✨
…On Sat, Oct 17, 2026, 5:20 PM Shahar Epstein ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In providers/google/src/airflow/providers/google/cloud/hooks/dataproc.py
<#74916 (comment)>:
> @@ -26,7 +26,7 @@
from collections.abc import MutableSequence, Sequence
Great! I'll take a look after CI is done
—
Reply to this email directly, view it on GitHub
<#74916?email_source=notifications&email_token=BMB777KZMHUVRDMWGBZDBN35UNMJPA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKNJVG43DGNBWHA22M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#discussion_r4302556526>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BMB777LAFAFZHHVCKUWJSAL5UNMJPAVCNFSNUABEKJSXA33TNF2G64TZHMZTGOBYGQ4DSMJ3JFZXG5LFHM2TQOJXGMYDCMBZG6QXMAQ>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/BMB777N6LUROVEAXDMDB7EL5UNMJPA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKNJVG43DGNBWHA22M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KUZTPN52GK4S7NFXXG>
and Android
<https://github.com/notifications/mobile/android/BMB777N7Z2RDCFPA42KMZCL5UNMJPA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKNJVG43DGNBWHA22M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
Download it today!
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
yuseok89
reviewed
Oct 18, 2026
yuseok89
left a comment
Contributor
There was a problem hiding this comment.
I left one question inline about test coverage for mapped teardown tasks across a Dag serialization round trip.
Contributor
There was a problem hiding this comment.
For a teardown declared with on_failure_fail_dagrun=True, has applying .as_teardown(on_success_succeed_dagrun=False) after .expand() also been checked?
If this path isn't covered yet, would it make sense to add a test checking that
- the configured value is preserved after the Dag is serialized and deserialized
- the restored value is reflected in the Dag run state evaluation
on_success_succeed_dagrun option to teardown tasks
This branch has not been deployed
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
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.
Add
on_success_succeed_dagrunto teardown tasks, so that a successful teardownno longer hides a failed work task.
closes: #74727
Problem
With
@teardown(on_failure_fail_dagrun=True)the teardown is the only task thatdecides the Dag run state. If a work task fails but the teardown succeeds, the
Dag run is marked SUCCESS and the failure is hidden.
Fix
New teardown option
on_success_succeed_dagrun(defaultTrue, so existing Dagsbehave exactly as before). With
on_failure_fail_dagrun=Trueandon_success_succeed_dagrun=False:What changed
airflow-core/.../models/dagrun.py:_tis_for_dagrun_statealso evaluates thetasks before a teardown that sets
on_success_succeed_dagrun=False.task-sdk(@teardown,as_teardown(),_internal/abstractoperator.py,_internal/mixins.py,xcom_arg.py,bases/decorator.py,bases/operator.py,mappedoperator.py): new argument, property and validation, with support formapped tasks and
.override().airflow-core/.../serialization/(schema.json,serialized_objects.py,definitions/baseoperator.py,definitions/mappedoperator.py,dag_version_diff.py): the new field is serialized and deserialized.test_dagrun.pycovers all six flag and state combinations;test_dag_serialization.pyregisters the new serialized field.Testing
test_dagrun.py,test_dag_serialization.pyand the task-sdk`test_setup_t
Was generative AI tooling used to co-author this PR?