Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions NIGHTLY_CODEX_FINAL_ATTEMPT_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Implemented a small test-only regression contribution.

Changed:
- [tests/test_models.py](/home/runner/work/oss-nightly-control/oss-nightly-control/target/tests/test_models.py:575): adds coverage that `model_dump()` works when `by_alias` is left unset, locking the behavior needed for issue #2921.
- [NIGHTLY_REPORT.md](/home/runner/work/oss-nightly-control/oss-nightly-control/target/NIGHTLY_REPORT.md:1): summarizes the work, tests, and remaining risk.

Verified:
- `uv run pytest tests/test_models.py -k "compat_model_dump_allows_default_by_alias or compat_method_no_error_for_warnings"`
- `uv run pytest tests/lib/test_azure.py::TestAzureLogging::test_azure_api_key_redacted`
- `uv run ruff check tests/test_models.py`

Note: `.codex-nightly-prompt.md` and `uv.lock` were already untracked before my changes; I left them untouched.
9 changes: 9 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,15 @@ class Model(BaseModel):
assert isinstance(model_dump(m, warnings=False), dict)


def test_compat_model_dump_allows_default_by_alias() -> None:
class Model(BaseModel):
foo: Optional[str] = Field(alias="FOO", default=None)

m = Model(FOO="hello")

assert model_dump(m) == {"foo": "hello"}


def test_to_json() -> None:
class Model(BaseModel):
foo: Optional[str] = Field(alias="FOO", default=None)
Expand Down