Skip to content

Commit d1914a1

Browse files
authored
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.
1 parent 669b2e0 commit d1914a1

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

airflow-core/src/airflow/api_fastapi/execution_api/datamodels/taskinstance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class TIHeartbeatInfo(StrictBaseModel):
230230

231231
# This model is not used in the API, but it is included in generated OpenAPI schema
232232
# for use in the client SDKs.
233-
class TaskInstance(StrictBaseModel):
233+
class TaskInstance(BaseModel):
234234
"""Schema for TaskInstance model with minimal required fields needed for Runtime."""
235235

236236
id: uuid.UUID

task-sdk/src/airflow/sdk/api/datamodels/_generated.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,6 @@ class TaskInstance(BaseModel):
350350
Schema for TaskInstance model with minimal required fields needed for Runtime.
351351
"""
352352

353-
model_config = ConfigDict(
354-
extra="forbid",
355-
)
356353
id: Annotated[UUID, Field(title="Id")]
357354
task_id: Annotated[str, Field(title="Task Id")]
358355
dag_id: Annotated[str, Field(title="Dag Id")]

0 commit comments

Comments
 (0)