Skip to content

Build: Bump datamodel-code-generator from 0.63.0 to 0.64.1#16993

Merged
huaxingao merged 2 commits into
apache:mainfrom
drexler-sky:bump-datamodel-code-generator-0.64.1
Jun 29, 2026
Merged

Build: Bump datamodel-code-generator from 0.63.0 to 0.64.1#16993
huaxingao merged 2 commits into
apache:mainfrom
drexler-sky:bump-datamodel-code-generator-0.64.1

Conversation

@drexler-sky

Copy link
Copy Markdown
Contributor

Regenerate open-api/rest-catalog-open-api.py with datamodel-code-generator 0.64.1. As of 0.64.0, optional primitive const fields no longer emit the const value as an injected default, so the generated discriminator fields (action/type) are now Literal[...] | None = None. Committing the regenerated output keeps make generate + git diff --exit-code green.

Supersedes #16985.

Regenerate open-api/rest-catalog-open-api.py with datamodel-code-generator
0.64.1. As of 0.64.0, optional primitive const fields no longer emit the
const value as an injected default, so the generated discriminator fields
(action/type) are now `Literal[...] | None = None`. Committing the
regenerated output keeps `make generate` + `git diff --exit-code` green.

Supersedes apache#16985.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@huaxingao huaxingao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

allOf:
- $ref: '#/components/schemas/BaseUpdate'
required:
- action

@ebyhr ebyhr Jun 28, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to change this file? Did CI fail without this change?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my understanding, BaseUpdate already declared required: action so action was always required by the parent schema. The subschemas (AssignUUIDUpdate etc.) just forgot to re-declare it in their own required: list, even though allOf: [$ref: BaseUpdate] already implies it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly. action was always required via BaseUpdate, so this isn't an API change. The generator reads each subschema's own required list (not the inherited allOf), and 0.64.1 stopped auto-filling fixed values, so the re-declared action now generates as nullable. Adding it to required keeps it non-nullable. CI doesn't actually fail without it.

@huaxingao huaxingao merged commit 2dbe96b into apache:main Jun 29, 2026
25 checks passed
jakelong95 pushed a commit to jakelong95/iceberg that referenced this pull request Jun 29, 2026
)

* Build: Bump datamodel-code-generator from 0.63.0 to 0.64.1

Regenerate open-api/rest-catalog-open-api.py with datamodel-code-generator
0.64.1. As of 0.64.0, optional primitive const fields no longer emit the
const value as an injected default, so the generated discriminator fields
(action/type) are now `Literal[...] | None = None`. Committing the
regenerated output keeps `make generate` + `git diff --exit-code` green.

Supersedes apache#16985.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Mark REST spec discriminators as required so they are not generated as nullable

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants