You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by as...@apache.org on 2025/04/07 19:34:38 UTC
(airflow) branch main updated: Make "TaskInstance" we send between executor and workers resilient to change (#48894)
This is an automated email from the ASF dual-hosted git repository.
ash pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new d1914a193d4 Make "TaskInstance" we send between executor and workers resilient to change (#48894)
d1914a193d4 is described below
commit d1914a193d46acd8678630aa3574af1aff76939e
Author: Ash Berlin-Taylor <as...@apache.org>
AuthorDate: Mon Apr 7 20:34:32 2025 +0100
Make "TaskInstance" we send between executor and workers resilient to change (#48894)
This is a similar sort of change to #48888, but in that case the fix is API
versioning, here we can't make use of that approach as the the TI isn't sent
over the API -- it's sent via the Executor to the worker.
So for now the best approach we have here is to allow extra, and be careful
when adding new fields to make sure it is version compatible.
This will need special handling in #48887 too.
---
.../src/airflow/api_fastapi/execution_api/datamodels/taskinstance.py | 2 +-
task-sdk/src/airflow/sdk/api/datamodels/_generated.py | 3 ---
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/airflow-core/src/airflow/api_fastapi/execution_api/datamodels/taskinstance.py b/airflow-core/src/airflow/api_fastapi/execution_api/datamodels/taskinstance.py
index d7d70931451..149b1466acd 100644
--- a/airflow-core/src/airflow/api_fastapi/execution_api/datamodels/taskinstance.py
+++ b/airflow-core/src/airflow/api_fastapi/execution_api/datamodels/taskinstance.py
@@ -230,7 +230,7 @@ class TIHeartbeatInfo(StrictBaseModel):
# This model is not used in the API, but it is included in generated OpenAPI schema
# for use in the client SDKs.
-class TaskInstance(StrictBaseModel):
+class TaskInstance(BaseModel):
"""Schema for TaskInstance model with minimal required fields needed for Runtime."""
id: uuid.UUID
diff --git a/task-sdk/src/airflow/sdk/api/datamodels/_generated.py b/task-sdk/src/airflow/sdk/api/datamodels/_generated.py
index 0e158744dc2..746af72c137 100644
--- a/task-sdk/src/airflow/sdk/api/datamodels/_generated.py
+++ b/task-sdk/src/airflow/sdk/api/datamodels/_generated.py
@@ -350,9 +350,6 @@ class TaskInstance(BaseModel):
Schema for TaskInstance model with minimal required fields needed for Runtime.
"""
- model_config = ConfigDict(
- extra="forbid",
- )
id: Annotated[UUID, Field(title="Id")]
task_id: Annotated[str, Field(title="Task Id")]
dag_id: Annotated[str, Field(title="Dag Id")]