Lohith625 commented on code in PR #56924:
URL: https://github.com/apache/airflow/pull/56924#discussion_r2631278659


##########
providers/standard/src/airflow/providers/standard/operators/trigger_dagrun.py:
##########
@@ -264,7 +272,26 @@ def execute(self, context: Context):
             )
 
     def _trigger_dag_af_3(self, context, run_id, parsed_logical_date):
-        from airflow.providers.common.compat.sdk import DagRunTriggerException
+        try:
+            from airflow.providers.common.compat.sdk import 
DagRunTriggerException
+        except Exception:
+            if TYPE_CHECKING:
+                from airflow.providers.common.compat.sdk import (
+                    DagRunTriggerException,  # type: ignore[no-redef]
+                )
+            else:
+                DagRunTriggerException = None  # type: ignore[assignment]
+
+        if self.note is not None:
+            logger = getattr(self, "log", None)
+            if logger is not None:
+                logger.info("Triggered DAG with note: %s", self.note)
+
+        if DagRunTriggerException is None:
+            raise AirflowException(

Review Comment:
   Thanks for the pointers — applied the logging refactor and replaced 
AirflowException with a standard RuntimeError per the guidelines.



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