ephraimbuddy commented on code in PR #70990:
URL: https://github.com/apache/airflow/pull/70990#discussion_r3704388739


##########
airflow-core/src/airflow/dag_processing/processor.py:
##########
@@ -361,7 +367,9 @@ def _execute_dag_callbacks(dagbag: DagBag, request: 
DagCallbackRequest, log: Fil
     ctx_from_server = request.context_from_server
 
     if ctx_from_server is not None and ctx_from_server.last_ti is not None:
-        task = dag.get_task(ctx_from_server.last_ti.task_id)
+        _, task = _get_dag_with_task(dagbag, request.dag_id, 
ctx_from_server.last_ti.task_id)
+        if TYPE_CHECKING:
+            assert task is not None

Review Comment:
   Type checking asserts are allowed in airflow core. We can't use RuntimeError 
since this code is only for type checkers and not reproducible in runtime



-- 
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]

Reply via email to