Fix duplicate bin detection for large cut inputs - #23601
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe ChangesCut bin-edge validation
Estimated code review effort: 1 (Trivial) | ~3 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@python/cudf/cudf/tests/general_functions/test_cut.py`:
- Around line 233-240: Extend test_cut_unique_bins_larger_than_integer_cache
with a duplicate-edge case using independently constructed equal integer objects
above 256, ensuring identity-based detection is exercised. Verify cut matches
pandas for the default duplicates="raise" behavior or explicitly test
duplicates="drop" with the corresponding expected result.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 112a3117-4d91-4f3e-a27a-2e7f58b818d6
📒 Files selected for processing (2)
python/cudf/cudf/core/cut.pypython/cudf/cudf/tests/general_functions/test_cut.py
mroeschke
left a comment
There was a problem hiding this comment.
Thanks. One question before I initiate the test suite
|
/ok to test e471df2 |
Summary
cudf.cut.The old check used object identity when comparing the lengths of the input and its set of unique values. For larger edge lists, equal integer lengths can be different objects, so a sequence with unique edges could be reported as containing duplicates. The new check compares the values directly.
Testing
python3 -m py_compile python/cudf/cudf/core/cut.py python/cudf/cudf/tests/general_functions/test_cut.pygit diff --check