Skip to content

Commit

Permalink
extra forbid in execution api
Browse files Browse the repository at this point in the history
  • Loading branch information
jx2lee committed Dec 17, 2024
1 parent 8848d6e commit 7e95d16
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion airflow/api_fastapi/execution_api/datamodels/taskinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from pydantic import Discriminator, Field, Tag, WithJsonSchema

from airflow.api_fastapi.common.types import UtcDateTime
from airflow.api_fastapi.core_api.base import BaseModel
from airflow.api_fastapi.core_api.base import BaseModel, ConfigDict
from airflow.api_fastapi.execution_api.datamodels.connection import ConnectionResponse
from airflow.api_fastapi.execution_api.datamodels.variable import VariableResponse
from airflow.utils.state import IntermediateTIState, TaskInstanceState as TIState, TerminalTIState
Expand Down Expand Up @@ -158,6 +158,8 @@ class DagRun(BaseModel):
class TIRunContext(BaseModel):
"""Response schema for TaskInstance run context."""

model_config = ConfigDict(extra="forbid")

dag_run: DagRun
"""DAG run information for the task instance."""

Expand Down
2 changes: 2 additions & 0 deletions airflow/api_fastapi/execution_api/datamodels/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
class VariableResponse(BaseModel):
"""Variable schema for responses with fields that are needed for Runtime."""

model_config = ConfigDict(extra="forbid")

key: str
val: str | None = Field(alias="value")

Expand Down
4 changes: 3 additions & 1 deletion airflow/api_fastapi/execution_api/datamodels/xcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@

from typing import Any

from airflow.api_fastapi.core_api.base import BaseModel
from airflow.api_fastapi.core_api.base import BaseModel, ConfigDict


class XComResponse(BaseModel):
"""XCom schema for responses with fields that are needed for Runtime."""

model_config = ConfigDict(extra="forbid")

key: str
value: Any
"""The returned XCom value in a JSON-compatible format."""

0 comments on commit 7e95d16

Please sign in to comment.