chore: CmpError -> CompareError - #3763
Conversation
- Renamed CmpError to CompareError in Comparable interface - Updated all implementations (int, bigint, string, float) - Updated SortError type projection to use T.CompareError - Updated all test cases and documentation - Updated Rust comments referencing the type name Co-authored-by: Sam Lijin <sam@boundaryml.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis PR renames the ChangesComparable Error Type Rename
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
⏭️ Performance benchmarks were skippedPerf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to To run them on this PR, do any of the following, then push a commit (or re-run CI):
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47b8c7994d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /// it undefaulted keeps the `Comparable` bound permissive over `CompareError`. | ||
| interface Comparable { | ||
| type CmpError | ||
| type CompareError |
There was a problem hiding this comment.
Regenerate snapshots after the associated-type rename
This rename changes the rendered stdlib HIR/TIR and the baml_src bytecode, but the checked-in insta snapshots were not updated: snapshots/compiles/__baml_std__/...03_hir.snap and ...04_tir.snap still contain T.CmpError, and snapshots/baml_src/arrays.snap still contains ComparableCmpError. The snapshot tests, including baml_tests/tests/baml_src.rs::bytecode, compare against those files, so CI will fail until the snapshots are regenerated alongside the rename.
Useful? React with 👍 / 👎.
|
No description provided. |
- Updated HIR snapshot with CompareError type projections - Updated TIR snapshot with CompareError references - Updated arrays snapshot with ComparableCompareError class name - All 48 comparable_sort tests pass Co-authored-by: Sam Lijin <sam@boundaryml.com>
Changes
This PR systematically renames
CmpErrortoCompareErrorthroughout the Sortable/Comparable interface implementation.Files Modified:
Comparableinterface and all builtin implementations (int, bigint, string, float)sort_by_keyerror type projectionThe change maintains full API compatibility - it's purely a naming improvement for better clarity.
Testing
PR Checklist
Slack Thread
Summary by CodeRabbit
CmpErrortoCompareError. Code that implements custom comparison logic or handles comparison errors requires updates to use the renamed error type.