bbovenzi commented on code in PR #42973: URL: https://github.com/apache/airflow/pull/42973#discussion_r1820795519
########## airflow/api_fastapi/core_api/serializers/dag_run.py: ########## @@ -18,13 +18,28 @@ from __future__ import annotations from datetime import datetime +from enum import Enum from pydantic import BaseModel, Field from airflow.utils.state import DagRunState from airflow.utils.types import DagRunTriggeredByType, DagRunType +class DAGRunModifyStates(str, Enum): + """Enum for DAG Run states when updating a DAG Run.""" + + QUEUED = DagRunState.QUEUED + SUCCESS = DagRunState.SUCCESS + FAILED = DagRunState.FAILED + + +class DAGRunPatchBody(BaseModel): + """DAG Run Serializer for PATCH requests.""" + Review Comment: Is it appropriate to add the dag run note here too? I know its a different model, but for the user that doesn't matter. I definitely see value in adding a note when you manually change the run's state. -- 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]
