Repository navigation
Compute the C3 order of models, raw schemas, the inheritance check and the target bindings in one place - #5602
Conversation
…d the target bindings in one place
Walkthrough
Merge Risk:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will degrade performance by 52.31%2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Breaking Change AnalysisResult: No breaking changes detected Reasoning: This PR is an internal refactor that moves the C3 method resolution order logic into a new private module _mro.py and points the existing callers at it. The new code gives the same results as before: linearize_data_models and the JSON Schema raw-schema linearization keep the first-head order, including the cycle-cutting walk; the target bindings use the python rule, which returns None on a cycle or conflict as the removed private _linearize and _c3 did; and the inheritance check in parser/base.py now asks the merge for the python rule and raises the same error message in exactly the cases where the old first-head merge broke a sequence order or met a duplicate. The public c3_merge name stays in model/base.py as an alias whose only new parameter is an optional keyword rule that defaults to the old behaviour. The only removed functions, _sort_for_mro, _linearize_depth_first, _linearize and _c3, are private. The other changes are internal architecture docs and repo tooling config. The behaviour diff gate compares with the last release, and its accepted cells all concern allOf schemas with scalar parts becoming RootModel or alias types. Its notes point to a different PR, and this diff does not touch allOf handling, so those changes do not come from this PR. The crash-fix cell is unrelated, and the both-fail cells do not change behaviour. No changes to code generation, templates, CLI or API, defaults, Python versions or error handling come from this PR. This analysis was produced by the release draft workflow |
|
🎉 Released in 0.88.0 This PR is now available in the latest release. See the release notes for details. |
Summary by CodeRabbit