Lee-W commented on code in PR #35256:
URL: https://github.com/apache/airflow/pull/35256#discussion_r1375999496


##########
airflow/models/dag.py:
##########
@@ -1428,6 +1428,13 @@ 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)
+            # 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.task_id in dag.task_dict.keys()]

Review Comment:
   Should we remove this comment?



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to