Bump datamodel-code-generator pin from 0.33.0 to 0.41.0#69854
Open
harishkesavarao wants to merge 1 commit into
Open
Bump datamodel-code-generator pin from 0.33.0 to 0.41.0#69854harishkesavarao wants to merge 1 commit into
harishkesavarao wants to merge 1 commit into
Conversation
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 apache#69616.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps the
datamodel-code-generatorpin used by thetask-sdkandairflow-ctlcodegenuv dependency groups from0.33.0to0.41.0. Both groups share a single workspace lockfile, so the pin must move together acrosstask-sdk/pyproject.tomlandairflow-ctl/pyproject.toml.Why 0.41.0
Dependabot PR #68816 tried to bump this dependency and was closed. Regenerating the OpenAPI-derived model files with newer generator releases is not a no-op. Bisecting versions between 0.33.0 and 0.67.0 (see #69616, item 3) found:
JsonValue-backed fields (e.g. inAssetResponse.extra,XComResponse.value) toJsonValue | None— a schema/type change.= Nonedefault from nullable-but-not-required fields on ~200 fields acrosstask-sdk/src/airflow/sdk/api/datamodels/_generated.pyandairflow-ctl/src/airflowctl/api/datamodels/generated.py, turning previously-optional constructor arguments into required ones — a breaking Pydantic v2 model-contract change, even thoughuse-default=trueis set in both[tool.datamodel-codegen]configs.RootModel[list]→RootModel[list[Any]]typing improvement inairflow-ctl'sgenerated.py. No field lost its default, no type was widened.Testing was done across several versions between 0.33.0 and 0.57.0 to identify where the change of behaviour occurs.
Testing
uv.lockregenerated cleanly:uv lockresolves 949 packages withdatamodel-code-generator v0.33.0 -> v0.41.0, no conflicts between thetask-sdkandairflow-ctlcodegengroups.task-sdk/src/airflow/sdk/api/datamodels/_generated.py— version-comment line only.airflow-ctl/src/airflowctl/api/datamodels/generated.py— version-comment line +RootModel[list]→RootModel[list[Any]](2 occurrences, semantically equivalent).airflow-ctl/src/airflowctl/api/datamodels/auth_generated.py— version-comment line only.task-sdktest suite:2703 passed, 6 skipped(pre-existing, unrelated skips: non-Linux-only test, pyiceberg version mismatch, pendulum~=2 cases).airflow-ctltest suite:267 passed.prek run --from-ref upstream/main --stage pre-commit: all applicable hooks passed, includingmypy-task-sdk,mypy-devel-common, ruff lint/format, andUpdate uv.lock.closes: #69616
Was generative AI tooling used to co-author this PR?