Make is_supported_cast fail for variable-width inputs - #23613
Conversation
|
pre-commit.ci autofix |
|
/ok to test 52419b5 |
|
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 cast support check now requires fixed-width source and target types. A unit test verifies that casting from ChangesCast support validation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cpp/tests/unary/cast_tests.cpp (1)
204-208: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winCover variable-width targets too.
The implementation checks both
FromandTo, but this test only checks a variable-width source. Add anINT32toSTRINGassertion so a regression in the target check cannot pass unnoticed.Proposed test extension
+ EXPECT_FALSE(cudf::is_supported_cast(cudf::data_type{cudf::type_id::INT32}, + cudf::data_type{cudf::type_id::STRING}));🤖 Prompt for 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. In `@cpp/tests/unary/cast_tests.cpp` around lines 204 - 208, Extend the StringToInt32IsUnsupported test to also assert that an INT32 source to STRING target is unsupported, covering the variable-width target path while preserving the existing assertion.
🤖 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.
Nitpick comments:
In `@cpp/tests/unary/cast_tests.cpp`:
- Around line 204-208: Extend the StringToInt32IsUnsupported test to also assert
that an INT32 source to STRING target is unsupported, covering the
variable-width target path while preserving the existing assertion.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: d85c5012-f405-490c-8203-2bd7700e60d6
📒 Files selected for processing (2)
cpp/src/unary/cast_ops.cucpp/tests/unary/cast_tests.cpp
|
/ok to test 34b1762 |
|
/ok to test 2b79f91 |
Description
cudf is_supported_cast returns true for string inputs. But cudf cast documentation says that it does not support variable-width
types.
This leads to an issue in velox (facebookincubator/velox#18450) where the engine thinks it can
use cudf cast to convert varchars to ints, though that will ultimately need an exception. Velox will eventually need to use
a different strings API for this conversion, but at least changing is_supported_cast will allow it to no longer route conversions
through this path.
Checklist