[FEA] Remove Deprecated Transform APIs - #23489
Conversation
|
/ok to test a11255a |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe transform API is unified under ChangesTransform API migration
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
cpp/include/cudf/transform.hpp (1)
71-82: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winFix the
@paramorder to match the function signature.The signature at Line 85-95 places
row_sizebeforenull_policy. The Doxygen comment at Line 77-79 documentsnull_policybeforerow_size. Doxygen resolves@paramby name, so this does not break the build, but it makes the comment harder to read against the declaration.For comparison, the deprecated
transform_extendeddoc at Line 109-110 listsrow_sizebeforenull_policy, matching its own signature order.📝 Proposed fix
* `@param` user_data User-defined device data to pass to the UDF. * `@param` is_null_aware Signifies the UDF will receive row inputs as optional values - * `@param` null_policy Signifies if a null mask should be created for the output column * `@param` row_size The row size of the transform operation. If not provided, it is inferred from the * input columns. + * `@param` null_policy Signifies if a null mask should be created for the output column * `@param` stream CUDA stream used for device memory operations and kernel launches🤖 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/include/cudf/transform.hpp` around lines 71 - 82, Reorder the `@param` entries in the transform documentation so row_size appears before null_policy, matching the function signature while leaving the parameter descriptions unchanged.python/pylibcudf/pylibcudf/transform.pyx (1)
303-333: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winDocument the implicit scalar-broadcast behavior.
The function now infers that a column with exactly one row is broadcast as a scalar whenever it differs from the size of the largest input (Line 353-375). The docstring does not mention this behavior. A caller reading the docstring cannot tell why a one-row
Columnmay be silently treated as a scalar.As per coding guidelines, "Ensure all public API methods have complete docstrings documenting parameters, return values, and behavior."
🤖 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 `@python/pylibcudf/pylibcudf/transform.pyx` around lines 303 - 333, Update the public transform function docstring around the inputs/behavior description to document that any input Column with exactly one row is implicitly broadcast as a scalar when its size differs from the largest input. Clarify that other input columns are expected to match the largest input size.Source: Coding guidelines
🧹 Nitpick comments (2)
cpp/include/cudf/transform.hpp (1)
85-95: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftConsider aligning parameter order between the two
transformoverloads.The single-column overload (Line 85-95) orders
user_databeforeis_null_aware. The multi-output overload (Line 168-178) ordersis_null_awarebeforeuser_data. Both overloads now share the nametransform, so this reversed order between two functions with the same name is more likely to trip up callers than when the functions had distinct names (transform_extendedvsmulti_transform). The multi-output overload also omits default values foris_null_aware,user_data, androw_size, unlike the single-column overload.Since this unified
transformname is new in this development cycle, aligning the two overloads now avoids a future deprecation cycle for the parameter order itself.Also applies to: 168-178
🤖 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/include/cudf/transform.hpp` around lines 85 - 95, Align the parameter order and defaults of both transform overloads: update the single-column transform declaration and the multi-output transform declaration so is_null_aware precedes user_data, and ensure the multi-output overload provides the same defaults for is_null_aware, user_data, and row_size as the single-column overload.python/pylibcudf/pylibcudf/transform.pyx (1)
353-375: 🗄️ Data Integrity & Integration | 🔵 Trivial | 🏗️ Heavy liftExpose scalar intent in the Python transform API.
transform()accepts onlySequence[Column], so it infersscalar_column_viewfrom input sizes. This cannot represent explicit scalar intent when all inputs have length 1. Add a Python-facing input wrapper that maps explicitly toscalar_column_view; retain size inference only for compatibility.🤖 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 `@python/pylibcudf/pylibcudf/transform.pyx` around lines 353 - 375, Update the Python-facing transform input handling around the input conversion loop to accept an explicit scalar-input wrapper and map it to cpp_transform.scalar_column_view. Preserve the existing size-based scalar inference for plain Column inputs so current callers remain compatible, while ensuring explicit scalar intent is honored even when all inputs have size one.
🤖 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/pylibcudf/pylibcudf/libcudf/transform.pxd`:
- Around line 31-36: Update the constructors declared in the Cython extern
definitions for scalar_column_view and transform_input to append except
+libcudf_exception_handler, covering all three overloads. Preserve their
existing signatures and rerun the Python build to verify C++ exceptions are
translated at the Python boundary.
---
Outside diff comments:
In `@cpp/include/cudf/transform.hpp`:
- Around line 71-82: Reorder the `@param` entries in the transform documentation
so row_size appears before null_policy, matching the function signature while
leaving the parameter descriptions unchanged.
In `@python/pylibcudf/pylibcudf/transform.pyx`:
- Around line 303-333: Update the public transform function docstring around the
inputs/behavior description to document that any input Column with exactly one
row is implicitly broadcast as a scalar when its size differs from the largest
input. Clarify that other input columns are expected to match the largest input
size.
---
Nitpick comments:
In `@cpp/include/cudf/transform.hpp`:
- Around line 85-95: Align the parameter order and defaults of both transform
overloads: update the single-column transform declaration and the multi-output
transform declaration so is_null_aware precedes user_data, and ensure the
multi-output overload provides the same defaults for is_null_aware, user_data,
and row_size as the single-column overload.
In `@python/pylibcudf/pylibcudf/transform.pyx`:
- Around line 353-375: Update the Python-facing transform input handling around
the input conversion loop to accept an explicit scalar-input wrapper and map it
to cpp_transform.scalar_column_view. Preserve the existing size-based scalar
inference for plain Column inputs so current callers remain compatible, while
ensuring explicit scalar intent is honored even when all inputs have size one.
🪄 Autofix (Beta)
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: 6f3ca566-0126-467f-aac4-80aa62db984b
📒 Files selected for processing (21)
cpp/benchmarks/binaryop/compiled_binaryop.cppcpp/benchmarks/ndsh/q09.cppcpp/benchmarks/transform/polynomials.cppcpp/benchmarks/transform/polynomials_concurrent.cppcpp/benchmarks/transform/transform.cppcpp/examples/string_transforms/compute_checksum_jit.cppcpp/examples/string_transforms/extract_email_jit.cppcpp/examples/string_transforms/format_phone_jit.cppcpp/examples/string_transforms/localize_phone_jit.cppcpp/include/cudf/transform.hppcpp/libcudf_streaming/benchmarks/streaming/ndsh/q01.cppcpp/libcudf_streaming/benchmarks/streaming/ndsh/q03.cppcpp/libcudf_streaming/benchmarks/streaming/ndsh/q09.cppcpp/src/stream_compaction/filter/filter.cucpp/src/transform/transform.cucpp/tests/jit/row_ir.cppcpp/tests/streams/transform_test.cppcpp/tests/transform/integration/unary_transform_test.cppjava/src/main/native/src/ColumnViewJni.cpppython/pylibcudf/pylibcudf/libcudf/transform.pxdpython/pylibcudf/pylibcudf/transform.pyx
…r/cudf into transform-api-deprecation
|
/ok to test 1b4d9ab |
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
…r/cudf into transform-api-deprecation
|
/ok to test 0838686 |
|
/ok to test cca80a2 |
|
/ok to test eff6a3d |
Description
This pull request removes the deprecated
transformAPI signature. It detected scalars by the size of the column views.transform_extendedwas added to solve this problem without a silent breaking change (ambiguous ODR resolution).multi_transformwas also added to support multi-output transforms, this also has a different signature.This pull request collapses them into a single
transformfunction.The old
transformfunction signature has been replaced with a new one,transform_extendedandmulti_transformare now deprecated.Python and Java bindings have also been updated.
Checklist