dstandish commented on code in PR #30271:
URL: https://github.com/apache/airflow/pull/30271#discussion_r1147727175
##########
airflow/models/dag.py:
##########
@@ -2207,6 +2207,9 @@ def partial_subset(
also_include.extend(t.get_flat_relatives(upstream=False))
if include_upstream:
also_include.extend(t.get_flat_relatives(upstream=True))
+ else:
+ upstream_setup_tasks = t.get_flat_relatives(upstream=True,
setup_only=True)
+ also_include.extend(upstream_setup_tasks)
Review Comment:
which task do you think it's missing?
i did add tests so pretty sure it's working properly.
i bet that the confusing bit here is that, there is logic, in
`get_flat_relatives` such that, whenever a setup is returned, its teardown (if
one exists) is returned
so, when you're going upstream, you don't need to do anything different.
but when you're going downstream, you need to add upstream setups (and their
towndows)
so, with downstream, the teardowns are added on line 2207, since they are
always downstream.
and then on 2211, it's just saying "if downstream and not upstream" then we
must _add_ the upstream setups.
now, you could argue that, it's not obvious from the signature / name of
get_flat_relatives that when setups are returned that their teardowns are also
returned. and if that's your thought i welcome any suggestion.
--
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]