kaxil commented on code in PR #44899: URL: https://github.com/apache/airflow/pull/44899#discussion_r1886346096
########## airflow/api_fastapi/execution_api/datamodels/taskinstance.py: ########## @@ -139,3 +142,34 @@ class TaskInstance(BaseModel): """Schema for setting RTIF for a task instance.""" RTIFPayload = RootModel[dict[str, str]] + + +class DagRun(BaseModel): + """Schema for DagRun model with minimal required fields needed for Runtime.""" + + # TODO: `dag_id` and `run_id` are duplicated from TaskInstance + # See if we can avoid sending these fields from API server and instead + # use the TaskInstance data to get the DAG run information in the client (Task Execution Interface). + dag_id: str + run_id: str + + logical_date: UtcDateTime + data_interval_start: UtcDateTime | None + data_interval_end: UtcDateTime | None + start_date: UtcDateTime + end_date: UtcDateTime | None + run_type: DagRunType + conf: Annotated[dict[str, Any], Field(default_factory=dict)] + + +class TIRunContext(BaseModel): + """Response schema for TaskInstance run context.""" + + dag_run: DagRun Review Comment: Correct -- 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]
