Update Python version, update API specs, fix non-nullable defaults in generated models - #18
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Regenerate affected exports and correct non-nullable model annotations before approval.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Refreshes API specifications and generated SDK clients, raises the minimum Python version to 3.11, and strengthens nullability/default handling.
Changes:
- Regenerates management, inference, and model-config APIs.
- Updates code generation, discriminator handling, and validation.
- Updates dependencies, CI, and tests.
- Corrects generated export ordering and non-nullable model annotations.
File summaries
| File | Summary |
|---|---|
tests/test_e2e.py |
Updates E2E cleanup and handling. |
tests/client/test_inference.py |
Adds strict nullability coverage. |
scripts/e2e_test_bootstrap/__main__.py |
Adjusts import formatting. |
scripts/apigen/specs/config.schema.json |
Refreshes model-config schemas. |
scripts/apigen/preprocess.py |
Rewrites discriminator mappings. |
scripts/apigen/postprocess.py |
Validates generated defaults. |
scripts/apigen/clientgen.py |
Narrows error-body handling. |
scripts/apigen/__main__.py |
Enables strict-nullable generation. |
pyproject.toml |
Raises Python and tooling requirements. |
baseten/client/modelconfig/_models.py |
Regenerates model-config models; nullable annotations require correction. |
baseten/client/modelconfig/__init__.py |
Generated exports need regeneration for stable ordering. |
baseten/client/managementapi/_client.py |
Regenerates the management client. |
baseten/client/managementapi/__init__.py |
Generated exports need regeneration for stable ordering. |
baseten/client/inferenceapi/_models.py |
Regenerates inference models. |
baseten/client/inferenceapi/_client.py |
Regenerates the inference client. |
baseten/client/inferenceapi/__init__.py |
Generated exports need regeneration for stable ordering. |
baseten/client/_management.py |
Updates management context-manager typing. |
baseten/client/_inference.py |
Updates inference context-manager typing. |
.github/workflows/ci.yml |
Updates CI Python and generation checks. |
Review details
Suppressed comments (1)
baseten/client/modelconfig/_models.py:645
- The schema for
BDNConfig.mountsis an array without anullbranch, but this generated annotation widens it tolist[BDNVolumeMount] | None, soBDNConfig(mounts=None)is accepted even though the spec rejects it. This leaves the strict-nullable contract broken for the newly added config fields (the same issue applies toaccessandhotload); preserve omission without widening the input type and add a regression test.
mounts: Annotated[
list[BDNVolumeMount] | None,
Field(
description="Existing BDN volumes to mount when the model starts.",
title="Mounts",
),
] = None
- Files reviewed: 19/22 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
rdingwall
approved these changes
Sep 15, 2026
This was referenced Sep 16, 2026
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.
🚀 What
Nonefor defaulted-but-non-nullable fields (closes Do not allow None for defaulted-but-null-not-allowed fields #14)datamodel-code-generator0.55 to 0.81,ty0.0.43 to 0.0.81, and dev deps (covers the open dependabot bumps)Backwards incompatible changes:
Noneand now raiseValidationError. Leaving a field unset is unchanged and still omits it from the requestStrEnum, so members compare equal to their string value and format as the bare value rather thanClassName.MEMBER💻 How
preprocessnow rewrites discriminatormappingvalues during the V1-suffix strip. They were left stale, which was harmless only because every previous discriminated union tagged on aconstfield. The new enum-tagged unions fall back to the mapping, so codegen silently dropped the discriminator (and crashed outright on 0.55)--strict-nullableso presence and nullability are modeled independentlypostprocesswraps literal defaults on model-typed fields in a validating call. Codegen emits the schema default verbatim (Limit | None = 500), relying onvalidate_default=Trueto coerce at runtime, which pydantic deliberately treats as a static type errorclientgennarrows the error-body handler toValidationErrorviacontextlib.suppress, replacing a blindexcept Exception: pass. Required by ruff 0.16, which expanded its default rule set from 59 to 413 rulesty: ignoredirectives that the newertyno longer needs🔬 Testing
uv run poe lint,typecheck, andtestall cleangenerate-apiruns are byte-stable, and CI regenerates and fails on any diffNonesendsnull, a value sends the value