[v3-3-test] Raise the datamodel-code-generator floor for the codegen toolchain (#70670) - #70976
Merged
Merged
Conversation
…70670) (cherry picked from commit b301429) Manual backport: datamodel-code-generator floor bumped 0.33.0 -> >=0.71.0 and models REGENERATED against v3-3-test's own spec (not copied from main). Test constructions in test_operations.py updated for the now-required nullable fields. test_task_command.py is main-only; main's divergent test_operations.py tail (ctl task-instance ops not on this branch) intentionally not backported.
vatsrahul1001
requested review from
amoghrajesh,
ashb,
bugraoz93,
choo121600,
dheerajturaga,
henry3260,
jason810496,
jscheffl,
kaxil,
mobuchowski,
o-nikolas,
potiuk and
shahar1
as code owners
August 3, 2026 09:50
…l test The regenerated model exposes the field as `schema_` with `Field(alias="schema")` and no `populate_by_name`, so pydantic requires the alias `schema=` at construction. Matches main's fix (#70670): construct with `schema=` plus `# type: ignore[call-arg]`.
ConnectionResponse.schema_ has Field(alias=schema) and no populate_by_name, so the source validates responses by the schema alias. The mock handlers dumped the model by field name, breaking the round-trip. Dump connection_response / connections_response mocks with by_alias=True (matches main #70670).
The #70127/#69719 reverts (now on v3-3-test) removed BackfillDagRunResponse, BackfillDagRunCollectionResponse and bundle_version from the API spec. Regenerated generated.py from the current spec with datamodel-code-generator>=0.71.0 so it reflects the reverts in the new-tool format. mypy airflow-ctl clean; no tests reference the removed models.
potiuk
approved these changes
Aug 4, 2026
amoghrajesh
approved these changes
Aug 4, 2026
vatsrahul1001
added a commit
that referenced
this pull request
Aug 5, 2026
…toolchain (#70670) (#70976) * Raise the datamodel-code-generator floor for the codegen toolchain (#70670) (cherry picked from commit b301429) Manual backport: datamodel-code-generator floor bumped 0.33.0 -> >=0.71.0 and models REGENERATED against v3-3-test's own spec (not copied from main). Test constructions in test_operations.py updated for the now-required nullable fields. test_task_command.py is main-only; main's divergent test_operations.py tail (ctl task-instance ops not on this branch) intentionally not backported. * Fix ConnectionResponse construction to use schema alias in airflow-ctl test The regenerated model exposes the field as `schema_` with `Field(alias="schema")` and no `populate_by_name`, so pydantic requires the alias `schema=` at construction. Matches main's fix (#70670): construct with `schema=` plus `# type: ignore[call-arg]`. * Serialize connection mock responses by alias in airflow-ctl tests ConnectionResponse.schema_ has Field(alias=schema) and no populate_by_name, so the source validates responses by the schema alias. The mock handlers dumped the model by field name, breaking the round-trip. Dump connection_response / connections_response mocks with by_alias=True (matches main #70670). * Regenerate airflow-ctl datamodels after merging v3-3-test The #70127/#69719 reverts (now on v3-3-test) removed BackfillDagRunResponse, BackfillDagRunCollectionResponse and bundle_version from the API spec. Regenerated generated.py from the current spec with datamodel-code-generator>=0.71.0 so it reflects the reverts in the new-tool format. mypy airflow-ctl clean; no tests reference the removed models.
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.
Backport of #70670 to
v3-3-test. Not a plain cherry-pick — the generated models had to be regenerated against v3-3-test's own spec rather than copied from main.What was done:
datamodel-code-generator[http]floor0.33.0→>=0.71.0intask-sdk/pyproject.tomlandairflow-ctl/pyproject.toml(clears the advisories in that range; codegen is a dev-only dependency group), plus the AGENTS.md command doc.generate-tasksdk-datamodels,generate-airflowctl-datamodels,generate-supervisor-schemas-snapshot).check-supervisor-schemas-versionspasses — the server contract is unchanged; this is purely a rendering change (drops spurious= Nonedefaults on required-nullable fields; tightenslist[Any]roots to typed tuples).uv.lock.Intentionally excluded:
test_task_command.py(main-only) and main's divergenttest_operations.pytail (tests ctl task-instance operations that don't exist on this branch).Local
mypyfor bothairflow-ctlandtask-sdkis green; codegen is idempotent on re-run.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines — manual backport with local regeneration + test adaptation (documented above).