ephraimbuddy commented on code in PR #36693:
URL: https://github.com/apache/airflow/pull/36693#discussion_r1451707891
##########
airflow/models/dag.py:
##########
@@ -1460,12 +1460,16 @@ def fetch_callback(
dagrun = DAG.fetch_dagrun(dag_id=dag.dag_id, run_id=dag_run_id,
session=session)
callbacks = callbacks if isinstance(callbacks, list) else
[callbacks]
tis = dagrun.get_task_instances(session=session)
+ # Filter out removed tasks and
# tis from a dagrun may not be a part of dag.partial_subset,
# since dag.partial_subset is a subset of the dag.
# This ensures that we will only use the accessible TI
# context for the callback.
- if dag.partial:
- tis = [ti for ti in tis if not ti.state == State.NONE]
+ tis = [
+ ti
+ for ti in tis
+ if ti.state != TaskInstanceState.REMOVED or (dag.partial and
not ti.state == State.NONE)
+ ]
Review Comment:
What you had earlier seems better, can we go back to it? Sorry for pushing
you to this direction
--
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]