dependabot[bot] opened a new pull request, #15074: URL: https://github.com/apache/iceberg/pull/15074
Bumps [datamodel-code-generator](https://github.com/koxudaxi/datamodel-code-generator) from 0.52.2 to 0.53.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/koxudaxi/datamodel-code-generator/releases">datamodel-code-generator's releases</a>.</em></p> <blockquote> <h2>0.53.0</h2> <h2>Breaking Changes</h2> <h3>Custom Template Update Required</h3> <ul> <li>Parser subclass signature change - The <code>Parser</code> base class now requires two generic type parameters: <code>Parser[ParserConfigT, SchemaFeaturesT]</code> instead of just <code>Parser[ParserConfigT]</code>. Custom parser subclasses must be updated to include the second type parameter. (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2929">#2929</a>) <pre lang="python"><code># Before class MyCustomParser(Parser["MyParserConfig"]): ... # After class MyCustomParser(Parser["MyParserConfig", "JsonSchemaFeatures"]): ... </code></pre> </li> <li>New abstract <code>schema_features</code> property required - Custom parser subclasses must now implement the <code>schema_features</code> abstract property that returns a <code>JsonSchemaFeatures</code> (or subclass) instance. (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2929">#2929</a>) <pre lang="python"><code>from functools import cached_property from datamodel_code_generator.parser.schema_version import JsonSchemaFeatures from datamodel_code_generator.enums import JsonSchemaVersion class MyCustomParser(Parser["MyParserConfig", "JsonSchemaFeatures"]): @cached_property def schema_features(self) -> JsonSchemaFeatures: return JsonSchemaFeatures.from_version(JsonSchemaVersion.Draft202012) </code></pre> </li> <li>Parser <code>_create_default_config</code> refactored to use class variable - Subclasses that override <code>_create_default_config</code> should now set the <code>_config_class_name</code> class variable instead. The base implementation uses this variable to dynamically instantiate the correct config class. (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2929">#2929</a>) <pre lang="python"><code># Before @classmethod def _create_default_config(cls, options: MyConfigDict) -> MyParserConfig: # custom implementation... # After _config_class_name: ClassVar[str] = "MyParserConfig" # No need to override _create_default_config if using standard config creation </code></pre> </li> <li>Template condition for default values changed - If you use custom Jinja2 templates based on <code>BaseModel_root.jinja2</code> or <code>RootModel.jinja2</code>, the condition for including default values has changed from <code>field.required</code> to <code>(field.required and not field.has_default)</code>. Update your custom templates if you override these files. (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2960">#2960</a>)</li> </ul> <h3>Code Generation Changes</h3> <ul> <li>RootModel default values now included in generated code - Previously, default values defined in JSON Schema or OpenAPI specifications for root models were not being applied to the generated Pydantic code. Now these defaults are correctly included. For example, a schema defining a root model with <code>default: 1</code> will generate <code>__root__: int = 1</code> (Pydantic v1) or <code>root: int = 1</code> (Pydantic v2) instead of just <code>__root__: int</code> or <code>root: int</code>. This may affect code that relied on the previous behavior where RootModel fields had no default values. (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2960">#2960</a>)</li> <li>Required fields with list defaults now use <code>default_factory</code> - Previously, required fields with list-type defaults (like <code>__root__: list[ID] = ['abc', 'efg']</code>) were generated with direct list assignments. Now they correctly use <code>Field(default_factory=lambda: ...)</code> which follows Python best practices for mutable defaults. This changes the structure of generated code for root models and similar patterns with list defaults. (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2958">#2958</a>) Before: <pre lang="python"><code>class Family(BaseModel): __root__: list[ID] = ['abc', 'efg'] </code></pre> After: <pre lang="python"><code>class Family(BaseModel): </code></pre> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/koxudaxi/datamodel-code-generator/blob/main/CHANGELOG.md">datamodel-code-generator's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.53.0">0.53.0</a> - 2026-01-12</h2> <h2>Breaking Changes</h2> <h3>Custom Template Update Required</h3> <ul> <li>Parser subclass signature change - The <code>Parser</code> base class now requires two generic type parameters: <code>Parser[ParserConfigT, SchemaFeaturesT]</code> instead of just <code>Parser[ParserConfigT]</code>. Custom parser subclasses must be updated to include the second type parameter. (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2929">#2929</a>) <pre lang="python"><code># Before class MyCustomParser(Parser["MyParserConfig"]): ... # After class MyCustomParser(Parser["MyParserConfig", "JsonSchemaFeatures"]): ... </code></pre> </li> <li>New abstract <code>schema_features</code> property required - Custom parser subclasses must now implement the <code>schema_features</code> abstract property that returns a <code>JsonSchemaFeatures</code> (or subclass) instance. (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2929">#2929</a>) <pre lang="python"><code>from functools import cached_property from datamodel_code_generator.parser.schema_version import JsonSchemaFeatures from datamodel_code_generator.enums import JsonSchemaVersion class MyCustomParser(Parser["MyParserConfig", "JsonSchemaFeatures"]): @cached_property def schema_features(self) -> JsonSchemaFeatures: return JsonSchemaFeatures.from_version(JsonSchemaVersion.Draft202012) </code></pre> </li> <li>Parser <code>_create_default_config</code> refactored to use class variable - Subclasses that override <code>_create_default_config</code> should now set the <code>_config_class_name</code> class variable instead. The base implementation uses this variable to dynamically instantiate the correct config class. (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2929">#2929</a>) <pre lang="python"><code># Before @classmethod def _create_default_config(cls, options: MyConfigDict) -> MyParserConfig: # custom implementation... # After _config_class_name: ClassVar[str] = "MyParserConfig" # No need to override _create_default_config if using standard config creation </code></pre> </li> <li>Template condition for default values changed - If you use custom Jinja2 templates based on <code>BaseModel_root.jinja2</code> or <code>RootModel.jinja2</code>, the condition for including default values has changed from <code>field.required</code> to <code>(field.required and not field.has_default)</code>. Update your custom templates if you override these files. (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2960">#2960</a>)</li> </ul> <h3>Code Generation Changes</h3> <ul> <li>RootModel default values now included in generated code - Previously, default values defined in JSON Schema or OpenAPI specifications for root models were not being applied to the generated Pydantic code. Now these defaults are correctly included. For example, a schema defining a root model with <code>default: 1</code> will generate <code>__root__: int = 1</code> (Pydantic v1) or <code>root: int = 1</code> (Pydantic v2) instead of just <code>__root__: int</code> or <code>root: int</code>. This may affect code that relied on the previous behavior where RootModel fields had no default values. (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2960">#2960</a>)</li> <li>Required fields with list defaults now use <code>default_factory</code> - Previously, required fields with list-type defaults (like <code>__root__: list[ID] = ['abc', 'efg']</code>) were generated with direct list assignments. Now they correctly use <code>Field(default_factory=lambda: ...)</code> which follows Python best practices for mutable defaults. This changes the structure of generated code for root models and similar patterns with list defaults. (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2958">#2958</a>) Before: <pre lang="python"><code>class Family(BaseModel): __root__: list[ID] = ['abc', 'efg'] </code></pre> After: <pre lang="python"><code></code></pre> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/koxudaxi/datamodel-code-generator/commit/a6a7b04f44c14086e7eb5636af9509bafafdb040"><code>a6a7b04</code></a> Fix bug in handling of graphql empty list defaults (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2948">#2948</a>)</li> <li><a href="https://github.com/koxudaxi/datamodel-code-generator/commit/838b2a087092ed746b1fee738058366a914ed887"><code>838b2a0</code></a> Fix array RootModel default value handling in parser (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2963">#2963</a>)</li> <li><a href="https://github.com/koxudaxi/datamodel-code-generator/commit/e717208f9b78929e70f5dbee8372764bf9bbad55"><code>e717208</code></a> Fix allOf array property merging to preserve child $ref (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2962">#2962</a>)</li> <li><a href="https://github.com/koxudaxi/datamodel-code-generator/commit/ae89a0016db3fd04ece3df8ab0e5f3cb236326c0"><code>ae89a00</code></a> Add GenerateConfig lazy import from top-level module (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2961">#2961</a>)</li> <li><a href="https://github.com/koxudaxi/datamodel-code-generator/commit/88c7fe4fd12713743b6a3dbcc667d3d53c63c820"><code>88c7fe4</code></a> Fix required list fields ignoring empty default values (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2958">#2958</a>)</li> <li><a href="https://github.com/koxudaxi/datamodel-code-generator/commit/4cbf3bfc7c4818e338e20f4451c506b62b622086"><code>4cbf3bf</code></a> Fix RootModel default value not being applied (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2960">#2960</a>)</li> <li><a href="https://github.com/koxudaxi/datamodel-code-generator/commit/aa088d670223bbb96fbef349a37d53e07cf6d0dc"><code>aa088d6</code></a> Add --use-closed-typed-dict option to control PEP 728 TypedDict generation (#...</li> <li><a href="https://github.com/koxudaxi/datamodel-code-generator/commit/98f3a48130380034d489069a373a5f55f343c1b4"><code>98f3a48</code></a> Fix IndexError when using --reuse-scope=tree with single file output (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2954">#2954</a>)</li> <li><a href="https://github.com/koxudaxi/datamodel-code-generator/commit/fa1fc11458ae74fe2324c842dc974f0c03c5a791"><code>fa1fc11</code></a> fix: move UnionMode import outside TYPE_CHECKING for Pydantic runtime⦠(<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2950">#2950</a>)</li> <li><a href="https://github.com/koxudaxi/datamodel-code-generator/commit/4decf36bdd143ff04a5eee54de6931a12b8c6cb6"><code>4decf36</code></a> Add comprehensive feature metadata to schema version dataclasses (<a href="https://redirect.github.com/koxudaxi/datamodel-code-generator/issues/2946">#2946</a>)</li> <li>Additional commits viewable in <a href="https://github.com/koxudaxi/datamodel-code-generator/compare/0.52.2...0.53.0">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
