shahar1 commented on code in PR #41872:
URL: https://github.com/apache/airflow/pull/41872#discussion_r1738105281


##########
airflow/sensors/external_task.py:
##########
@@ -383,8 +383,11 @@ def _check_for_existence(self, session) -> None:
         if not os.path.exists(correct_maybe_zipped(dag_to_wait.fileloc)):
             raise AirflowException(f"The external DAG {self.external_dag_id} 
was deleted.")
 
+        refreshed_dag_info = 
DagBag(dag_to_wait.fileloc).get_dag(self.external_dag_id)
+        if not refreshed_dag_info:
+            raise AirflowException(f"The external DAG {self.external_dag_id} 
was deleted.")
+

Review Comment:
   ```suggestion
           refreshed_dag_info = 
DagBag(dag_to_wait.fileloc).get_dag(self.external_dag_id)
           if not (os.path.exists(correct_maybe_zipped(dag_to_wait.fileloc)) 
and refreshed_dag_info):
               raise AirflowException(f"The external DAG {self.external_dag_id} 
was deleted.")
   ```



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