Lee-W commented on code in PR #48214:
URL: https://github.com/apache/airflow/pull/48214#discussion_r2038898137


##########
airflow-core/src/airflow/exceptions.py:
##########
@@ -246,6 +246,17 @@ class AirflowTimetableInvalid(AirflowException):
     """Raise when a DAG has an invalid timetable."""
 
 
+class DagIsPaused(AirflowException):
+    """Raise when a DAG is paused and something tries to run it."""

Review Comment:
   ```suggestion
       """Raise when a dag is paused and something tries to run it."""
   ```



##########
airflow-core/src/airflow/exceptions.py:
##########
@@ -246,6 +246,17 @@ class AirflowTimetableInvalid(AirflowException):
     """Raise when a DAG has an invalid timetable."""
 
 
+class DagIsPaused(AirflowException):
+    """Raise when a DAG is paused and something tries to run it."""
+
+    def __init__(self, dag_id: str) -> None:
+        super().__init__(dag_id)
+        self.dag_id = dag_id
+
+    def __str__(self) -> str:
+        return f"DAG {self.dag_id} is paused"

Review Comment:
   ```suggestion
           return f"Dag {self.dag_id} is paused"
   ```



##########
providers/standard/tests/unit/standard/operators/test_trigger_dagrun.py:
##########
@@ -734,3 +735,21 @@ def test_dagstatetrigger_run_id_with_clear_and_reset(self, 
dag_maker):
 
         # The second DagStateTrigger call should still use the original 
`logical_date` value.
         assert mock_task_defer.call_args_list[1].kwargs["trigger"].run_ids == 
[run_id]
+
+    def test_trigger_dagrun_with_fail_when_dag_is_paused(self, dag_maker):
+        """Test TriggerDagRunOperator with skip_when_already_exists."""

Review Comment:
   ```suggestion
           """Test TriggerDagRunOperator with fail_when_dag_is_paused set to 
True."""
   ```



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