kaxil commented on code in PR #61063:
URL: https://github.com/apache/airflow/pull/61063#discussion_r2761637473


##########
providers/standard/src/airflow/providers/standard/operators/trigger_dagrun.py:
##########
@@ -253,40 +265,65 @@ def execute(self, context: Context):
         self.trigger_run_id = run_id
 
         if self.fail_when_dag_is_paused:
-            dag_model = DagModel.get_current(self.trigger_dag_id)
-            if not dag_model:
-                raise ValueError(f"Dag {self.trigger_dag_id} is not found")
-            if dag_model.is_paused:
-                # TODO: enable this when dag state endpoint available from 
task sdk
-                # if AIRFLOW_V_3_0_PLUS:
-                #     raise DagIsPaused(dag_id=self.trigger_dag_id)
-                raise AirflowException(f"Dag {self.trigger_dag_id} is paused")
+            if AIRFLOW_V_3_0_PLUS:
+                # In Airflow 3.0, use Supervisor API to get DAG info
+                from airflow.sdk.execution_time.comms import DagResult, GetDag
+                from airflow.sdk.execution_time.task_runner import 
SUPERVISOR_COMMS

Review Comment:
   A better design (atleast imo) would be to fail it on server side, when POST 
is sent to `"/execution/dag-runs/{dag_id}/{run_id}"` -- and have an error type 
similar to the plumbing for `reset_dag_run`



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