kaxil commented on code in PR #61063:
URL: https://github.com/apache/airflow/pull/61063#discussion_r2761638365
##########
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:
https://github.com/apache/airflow/blob/cec8ba68f19cb21293979a6f042909d5ccbaac11/task-sdk/src/airflow/sdk/api/client.py#L706-L713
--
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]