eladkal commented on code in PR #30270:
URL: https://github.com/apache/airflow/pull/30270#discussion_r1147260429
##########
airflow/ti_deps/deps/trigger_rule_dep.py:
##########
@@ -263,8 +280,28 @@ def _iter_upstream_conditions() ->
Iterator[ColumnOperators]:
elif trigger_rule == TR.ALL_SKIPPED:
if success or failed:
new_state = TaskInstanceState.SKIPPED
-
+ elif trigger_rule == TR.ALL_DONE_SETUP_SUCCESS:
+ # when there is an upstream setup and they have all skipped,
then skip
+ if upstream_done and upstream_setup and skipped_setup >=
upstream_setup:
+ new_state = TaskInstanceState.SKIPPED
+ logging.warning(
+ "ti=%s skipped_setup >= upstream_setup (%s >= %s),
marking skipped",
+ ti.task_id,
+ skipped_setup,
+ upstream_setup,
+ )
+ elif upstream_done and upstream_setup > success_setup:
+ # when there is an upstream setup, they must all succeed
+ # otherwise, behave same as all done.
Review Comment:
Yeah I have some concerns/questions.
By adding new trigger rules we in fact declare that this is a configuration
that a user has to specify manually when he writes the dag. This open a whole
new domain of issues about setting the rule wrong.
Trigger rules are something that many new users get confuse about. I myself
answered so many questions related to it in various support channels. We should
take this under advisment and try not making it more complecated.
For now I'm missing the part why we must get manual input from the user
(trigger rule or other) to get the teardown action working as we want. I always
imagined it as if teardown exsist it should run (just like it happes in
teardown of test class but again maybe I'm getting this wrong.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]