fix(v1): route json() dumps kwargs to json.dumps, not dict() - #166
Merged
Merged
Conversation
- indent, sort_keys and separators reached BaseModel.dict() and raised TypeError; pydantic v1 names the dict() arguments and collects the rest - add the v1 parity test that covers the split
Contributor
Release previewMerging this PR would release v1.0.3 (current: Changelog preview (truncated)## v1.0.3 (2026-09-24)
### Bug Fixes
- **v1**: Route json() dumps kwargs to json.dumps, not dict()
([`41b65de`](https://github.com/OO-LD/oold-python/commit/41b65ded09e9f25c5986179909e1d46df67bf805))
Preview via python-semantic-release and conventional commits. |
Contributor
📊 Benchmark ResultsClick to see benchmark comparisonThreshold: 1.3x (30% slower triggers a regression warning) Note: Benchmarks are informational only and won't fail the build. 💡 Tip: Download the |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Regression since v1.0.0, reported downstream.
LinkedBaseModel.json()of the v1 descriptor binding forwards every keyword todict():pydantic v1 splits them:
BaseModel.json()names thedict()arguments explicitly and collects the rest into**dumps_kwargs, which go tojson.dumps. So a valid v1 call raises:Same for
sort_keysandseparators. The legacy binding (OOLD_DESCRIPTOR_BINDING=0) is unaffected -src/oold/model/v1/__init__.py:723keeps the explicit v1 signature.Changes:
dict(), keyed on the argumentsBaseModel.dictacceptstest_json_passes_dumps_kwargs_to_json_dumpstotests/test_compat_parity_v1.py;.json()had no coverage anywhere in the suite, which is how this shipped734 passed under both bindings.