pierrejeambrun commented on code in PR #54886:
URL: https://github.com/apache/airflow/pull/54886#discussion_r2460698954
##########
airflow-core/src/airflow/api_fastapi/execution_api/datamodels/dagrun.py:
##########
@@ -30,9 +30,16 @@ class TriggerDAGRunPayload(StrictBaseModel):
logical_date: UtcDateTime | None = None
conf: dict = Field(default_factory=dict)
reset_dag_run: bool = False
+ reset_mode: str = "all"
Review Comment:
The server side can use an enum, and the API will return a 'string', client
(sdk client), is free to use that as a 'string' or as a an enum if it wants
further type checking.
I think an enum for the server side (execution_api + public api) would help
documenting and typing things properly. It doesn't have to be in the standard
provider.
##########
airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_dag_runs.py:
##########
@@ -453,3 +453,56 @@ def
test_get_previous_dag_run_invalid_state_parameter(self, client, session, dag
)
assert response.status_code == 422
+
+
+class TestDagRunClearRestMode:
Review Comment:
typo
##########
providers/standard/tests/unit/standard/operators/test_trigger_dagrun.py:
##########
@@ -28,18 +28,23 @@
from airflow.configuration import conf
from airflow.exceptions import AirflowException, DagRunAlreadyExists,
TaskDeferred
from airflow.models.dag import DagModel
+from airflow.models.dag_version import DagVersion
from airflow.models.dagrun import DagRun
from airflow.models.log import Log
from airflow.models.taskinstance import TaskInstance
+from airflow.providers.standard.operators.empty import EmptyOperator
from airflow.providers.standard.operators.trigger_dagrun import DagIsPaused,
TriggerDagRunOperator
from airflow.providers.standard.triggers.external_task import DagStateTrigger
from airflow.utils.session import create_session
from airflow.utils.state import DagRunState, TaskInstanceState
from airflow.utils.types import DagRunType
+from tests_common.test_utils.dag import sync_dag_to_db
from tests_common.test_utils.db import parse_and_sync_to_db
from tests_common.test_utils.version_compat import AIRFLOW_V_3_0_PLUS,
AIRFLOW_V_3_1_PLUS
+if AIRFLOW_V_3_0_PLUS:
+ from airflow.sdk import DAG
Review Comment:
There is already a check bellow, you can move that import inside it.
--
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]