jscheffl commented on code in PR #44433:
URL: https://github.com/apache/airflow/pull/44433#discussion_r1864421516
##########
providers/src/airflow/providers/edge/worker_api/datamodels.py:
##########
@@ -53,19 +55,56 @@ class JsonRpcRequest(JsonRpcRequestBase):
)
-class WorkerStateBody(BaseModel):
+class EdgeJobBase(BaseModel):
+ """Basic attributes of a job on the edge worker."""
+
+ dag_id: str = Field(title="Dag ID", description="Identifier of the DAG to
which the task belongs.")
+ task_id: str = Field(title="Task ID", description="Task name in the DAG.")
+ run_id: str = Field(title="Run ID", description="Run ID of the DAG
execution.")
+ map_index: int = Field(
+ title="Map Index",
+ description="For dynamically mapped tasks the mapping number, -1 if
the task is not mapped.",
+ )
Review Comment:
Just Flask has a parsing problem and therefore the Airflow 2.10 REST
implementation in Connexion uses "string" for the map-index as there can be
negative values. But I convert this to int() before going into the logic.
The primary implementation is FastAPI and this can correctly treat negative
integer values. So just in the openapi specs of connexion and the
`_v2_routes.py` the map_index is treated as string to make it working.
Otherwise FastAPI and Pydantic models should be consistent.
--
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]