kaxil opened a new pull request, #67726:
URL: https://github.com/apache/airflow/pull/67726

   `TriggerDagRunOperator(fail_when_dag_is_paused=True)` doesn't work on 
Airflow 3.x. The paused check calls `DagModel.get_current()`, which goes 
straight to the ORM, and that's blocked from task execution in Airflow 3 
("Direct database access via the ORM is not allowed in Airflow 3.0"). #56965 
stubbed it out to raise `NotImplementedError` for the flag on 3.x as a stop-gap.
   
   This wires the check to the task-SDK `get_dag()` accessor (backed by the 
`GetDag` execution-API endpoint from #56955) and raises `DagIsPaused` when the 
target is paused. The check runs in `execute()` before the operator raises 
`DagRunTriggerException`, so a paused target fails the task without triggering 
anything. I gated it on `AIRFLOW_V_3_2_PLUS` because that's when the endpoint 
and the `RuntimeTaskInstance.get_dag()` accessor landed: it works on 3.2.0+, 
still raises `NotImplementedError` at construction on 3.0/3.1 (the endpoint 
isn't there and tasks can't reach the DB, so there's nothing to query), and the 
2.x path is untouched since the direct ORM lookup is fine there.
   
   The original report is on 3.1.0, so those users will need to move to 3.2.0+ 
to pick this up. It can't be backported since the endpoint only exists from 
3.2.0.
   
   Fixes #56954.
   


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