rawwar commented on code in PR #54972:
URL: https://github.com/apache/airflow/pull/54972#discussion_r2347683439


##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -909,13 +909,14 @@ def process_executor_events(
                 # Get task from the Serialized DAG
                 try:
                     dag = 
scheduler_dag_bag.get_dag_for_run(dag_run=ti.dag_run, session=session)
-                    cls.logger().error(
-                        "DAG '%s' for task instance %s not found in 
serialized_dag table",
-                        ti.dag_id,
-                        ti,
-                    )
-                    if TYPE_CHECKING:
-                        assert dag
+                    if not dag:
+                        cls.logger().error(
+                            "DAG '%s' for task instance %s not found in 
serialized_dag table",
+                            ti.dag_id,
+                            ti,
+                        )
+                        raise

Review Comment:
   regarding the [original 
comment](https://github.com/apache/airflow/pull/54972#discussion_r2312183965) , 
i checked `get_dag_for_run` and see that it doesn't raise an exception when dag 
not found. So, i am manually raising



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