Skip to content

Rewrite conversion in terms of column#15213

Merged
rapids-bot[bot] merged 4 commits intorapidsai:branch-24.04from
vyasr:refactor/arrow_scalar
Mar 8, 2024
Merged

Rewrite conversion in terms of column#15213
rapids-bot[bot] merged 4 commits intorapidsai:branch-24.04from
vyasr:refactor/arrow_scalar

Conversation

@vyasr
Copy link
Copy Markdown
Contributor

@vyasr vyasr commented Mar 2, 2024

Description

It looks like soon after I started investigating scalar conversions for #14121 (but well before I made the PR) a major underlying hole was plugged in pyarrow via apache/arrow#36162. Most of #14121 was created to give us a way to handle scalars from pyarrow generically in libcudf. Now that pyarrow scalars can be easily tossed into arrays, we no longer really need separate scalar functions in libcudf; we can simply create an array from the scalar, put it into a table, and then call the table function.

Additionally, arrow also has a function for creating an array from a scalar. This function is not new but was previously undocumented. The builder code added to libcudf in #14121 can be removed and replaced with that factory. The scalar conversion is as simple as calling that arrow function and then using our preexisting from_arrow function on the resulting array.

For now this PR is just a simplification of internals. Future PRs will remove the scalar API once we have a more standard path for the conversion of arrays via the C Data Interface.

Checklist

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

@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Mar 4, 2024
@vyasr vyasr added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Mar 4, 2024
@vyasr vyasr marked this pull request as ready for review March 4, 2024 23:55
@vyasr vyasr requested review from a team as code owners March 4, 2024 23:55
@vyasr vyasr requested review from isVoid, mythrocks, shrshi and shwina March 4, 2024 23:55
Copy link
Copy Markdown
Contributor

@davidwendt davidwendt left a comment

Choose a reason for hiding this comment

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

Approving C++ changes

@vyasr
Copy link
Copy Markdown
Contributor Author

vyasr commented Mar 8, 2024

/merge

@rapids-bot rapids-bot bot merged commit ec24c02 into rapidsai:branch-24.04 Mar 8, 2024
@vyasr vyasr deleted the refactor/arrow_scalar branch March 8, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change Python Affects Python cuDF API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants