Skip to content

Commit 15a4478

Browse files
Bump datamodel-code-generator pin from 0.33.0 to 0.41.0 (#69854)
The pin was stuck at 0.33.0 because later releases change how use-default interacts with nullable/optional fields. Versions 0.42.2 through at least 0.67.0 widen JsonValue-backed fields to JsonValue | None, and 0.57.0+ additionally drops the = None default from nullable-optional fields, turning ~200 fields in the Task SDK Execution API client and the airflow-ctl API client from optional into required -- a breaking Pydantic v2 model-contract change. 0.41.0 is the newest release that still regenerates both clients with a diff limited to the generator version-comment line (plus one benign RootModel[list] -> RootModel[list[Any]] typing improvement in airflow-ctl's generated.py), so it unblocks the dependency without carrying either regression forward. Closes the datamodel-code-generator item from #69616.
1 parent 1073e49 commit 15a4478

6 files changed

Lines changed: 14 additions & 14 deletions

File tree

airflow-ctl/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ dev = [
149149
"apache-airflow-devel-common",
150150
]
151151
codegen = [
152-
"datamodel-code-generator[http]==0.33.0",
152+
"datamodel-code-generator[http]==0.41.0",
153153
"apache-airflow-devel-common"
154154
]
155155

airflow-ctl/src/airflowctl/api/datamodels/auth_generated.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: v2-simple-auth-manager-generated.yaml
3-
# version: 0.33.0
3+
# version: 0.41.0
44

55
from __future__ import annotations
66

airflow-ctl/src/airflowctl/api/datamodels/generated.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: v2-rest-api-generated.yaml
3-
# version: 0.33.0
3+
# version: 0.41.0
44

55
from __future__ import annotations
66

@@ -262,8 +262,8 @@ class ClearPartitionsResponse(BaseModel):
262262
dry_run: Annotated[bool, Field(title="Dry Run")]
263263

264264

265-
class TaskIds(RootModel[list]):
266-
root: Annotated[list, Field(max_length=2, min_length=2)]
265+
class TaskIds(RootModel[list[Any]]):
266+
root: Annotated[list[Any], Field(max_length=2, min_length=2)]
267267

268268

269269
class ClearTaskInstancesBody(BaseModel):
@@ -303,8 +303,8 @@ class ClearTaskInstancesBody(BaseModel):
303303
note: Annotated[Note | None, Field(title="Note")] = None
304304

305305

306-
class Value(RootModel[list]):
307-
root: Annotated[list, Field(max_length=2, min_length=2, title="Value")]
306+
class Value(RootModel[list[Any]]):
307+
root: Annotated[list[Any], Field(max_length=2, min_length=2, title="Value")]
308308

309309

310310
class ConfigOption(BaseModel):

task-sdk/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ exclude_also = [
215215

216216
[dependency-groups]
217217
codegen = [
218-
"datamodel-code-generator[http]==0.33.0",
218+
"datamodel-code-generator[http]==0.41.0",
219219
"openapi-spec-validator>=0.7.1",
220220
"svcs>=25.1.0",
221221
"rich>=13.6.0",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: http://0.0.0.0:8080/execution/openapi.json
3-
# version: 0.33.0
3+
# version: 0.41.0
44

55
# Licensed to the Apache Software Foundation (ASF) under one
66
# or more contributor license agreements. See the NOTICE file

uv.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)