Skip to content

[FEA] Remove Deprecated Transform APIs - #23489

Open
lamarrr wants to merge 10 commits into
rapidsai:mainfrom
lamarrr:transform-api-deprecation
Open

[FEA] Remove Deprecated Transform APIs#23489
lamarrr wants to merge 10 commits into
rapidsai:mainfrom
lamarrr:transform-api-deprecation

Conversation

@lamarrr

@lamarrr lamarrr commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Description

This pull request removes the deprecated transform API signature. It detected scalars by the size of the column views.
transform_extended was added to solve this problem without a silent breaking change (ambiguous ODR resolution).
multi_transform was also added to support multi-output transforms, this also has a different signature.
This pull request collapses them into a single transform function.
The old transform function signature has been replaced with a new one, transform_extended and multi_transform are now deprecated.

Python and Java bindings have also been updated.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@copy-pr-bot

copy-pr-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added libcudf Affects libcudf (C++/CUDA) code. Python Affects Python cuDF API. Java Affects Java cuDF API. pylibcudf Issues specific to the pylibcudf package labels Jul 31, 2026
@GPUtester GPUtester moved this to In Progress in cuDF Python Jul 31, 2026
@lamarrr
lamarrr marked this pull request as ready for review July 31, 2026 04:30
@lamarrr
lamarrr requested review from a team as code owners July 31, 2026 04:30
@lamarrr lamarrr added feature request New feature or request breaking Breaking change labels Jul 31, 2026
@lamarrr

lamarrr commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test a11255a

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Summary by CodeRabbit

  • API Updates

    • Consolidated single- and multi-output transformations under cudf::transform.
    • Deprecated legacy transformation entry points and removed the legacy single-column overload.
    • Added support for column and scalar inputs through the updated interface.
  • Compatibility

    • Updated Python, Java, and CUDA integrations while preserving null handling, output behavior, and execution options.
  • Examples and Benchmarks

    • Updated examples, benchmarks, streaming workflows, filtering, and tests to use the current transformation API.

Walkthrough

The transform API is unified under cudf::transform. Deprecated compatibility APIs remain. C++ callers, Python bindings, Java JNI code, benchmarks, examples, and tests now use the updated interface.

Changes

Transform API migration

Layer / File(s) Summary
Transform API contract and implementation
cpp/include/cudf/transform.hpp, cpp/src/transform/transform.cu
The table-producing and single-output APIs now use cudf::transform. transform_extended and multi_transform remain as deprecated forwarding APIs.
Python binding update
python/pylibcudf/pylibcudf/libcudf/transform.pxd, python/pylibcudf/pylibcudf/transform.pyx
Python bindings now use transform descriptors, spans, udf_source_type, scalar broadcasting, and row-size handling.
Runtime and language integrations
cpp/src/stream_compaction/filter/filter.cu, cpp/src/transform/transform.cu, java/src/main/native/src/ColumnViewJni.cpp
Predicate evaluation, JIT column computation, and Java JNI transformation now call cudf::transform.
Benchmark and example migration
cpp/benchmarks/..., cpp/examples/string_transforms/*, cpp/libcudf_streaming/benchmarks/streaming/ndsh/*
Benchmarks and examples replace deprecated transform calls while preserving transformation settings and returned columns.
Transform test migration
cpp/tests/jit/row_ir.cpp, cpp/tests/streams/transform_test.cpp, cpp/tests/transform/integration/unary_transform_test.cpp
Tests use the unified API across unary, multi-output, string, dictionary, null-handling, CUDA/PTX, and error-handling cases.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested labels: improvement

Suggested reviewers: brandon-b-miller, simoneves, qbacpey

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.52% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: removing deprecated transform APIs and consolidating the transform interface.
Description check ✅ Passed The description accurately explains the transform API consolidation and the related Python and Java binding updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Fix the @param order to match the function signature.

The signature at Line 85-95 places row_size before null_policy. The Doxygen comment at Line 77-79 documents null_policy before row_size. Doxygen resolves @param by name, so this does not break the build, but it makes the comment harder to read against the declaration.

For comparison, the deprecated transform_extended doc at Line 109-110 lists row_size before null_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 win

Document 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 Column may 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 lift

Consider aligning parameter order between the two transform overloads.

The single-column overload (Line 85-95) orders user_data before is_null_aware. The multi-output overload (Line 168-178) orders is_null_aware before user_data. Both overloads now share the name transform, 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_extended vs multi_transform). The multi-output overload also omits default values for is_null_aware, user_data, and row_size, unlike the single-column overload.

Since this unified transform name 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 lift

Expose scalar intent in the Python transform API.

transform() accepts only Sequence[Column], so it infers scalar_column_view from input sizes. This cannot represent explicit scalar intent when all inputs have length 1. Add a Python-facing input wrapper that maps explicitly to scalar_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

📥 Commits

Reviewing files that changed from the base of the PR and between 7f58752 and a11255a.

📒 Files selected for processing (21)
  • cpp/benchmarks/binaryop/compiled_binaryop.cpp
  • cpp/benchmarks/ndsh/q09.cpp
  • cpp/benchmarks/transform/polynomials.cpp
  • cpp/benchmarks/transform/polynomials_concurrent.cpp
  • cpp/benchmarks/transform/transform.cpp
  • cpp/examples/string_transforms/compute_checksum_jit.cpp
  • cpp/examples/string_transforms/extract_email_jit.cpp
  • cpp/examples/string_transforms/format_phone_jit.cpp
  • cpp/examples/string_transforms/localize_phone_jit.cpp
  • cpp/include/cudf/transform.hpp
  • cpp/libcudf_streaming/benchmarks/streaming/ndsh/q01.cpp
  • cpp/libcudf_streaming/benchmarks/streaming/ndsh/q03.cpp
  • cpp/libcudf_streaming/benchmarks/streaming/ndsh/q09.cpp
  • cpp/src/stream_compaction/filter/filter.cu
  • cpp/src/transform/transform.cu
  • cpp/tests/jit/row_ir.cpp
  • cpp/tests/streams/transform_test.cpp
  • cpp/tests/transform/integration/unary_transform_test.cpp
  • java/src/main/native/src/ColumnViewJni.cpp
  • python/pylibcudf/pylibcudf/libcudf/transform.pxd
  • python/pylibcudf/pylibcudf/transform.pyx

Comment thread python/pylibcudf/pylibcudf/libcudf/transform.pxd Outdated
@lamarrr

lamarrr commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 1b4d9ab

Comment thread python/pylibcudf/pylibcudf/transform.pyx Outdated
lamarrr and others added 4 commits July 31, 2026 17:45
@lamarrr

lamarrr commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 0838686

@lamarrr

lamarrr commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test cca80a2

@lamarrr

lamarrr commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test eff6a3d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change feature request New feature or request Java Affects Java cuDF API. libcudf Affects libcudf (C++/CUDA) code. pylibcudf Issues specific to the pylibcudf package Python Affects Python cuDF API.

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

5 participants