Skip to content

Avoid pylibcudf.interop.to_arrow in DataFrame.to_polars in cudf_polars #19198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 25, 2025

Conversation

mroeschke
Copy link
Contributor

Description

This PR and #18564 are the last PRs removing pylibcudf.interop.to_arrow in cudf_polars.

Towards #18534

Checklist

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

@mroeschke mroeschke self-assigned this Jun 18, 2025
@mroeschke mroeschke requested a review from a team as a code owner June 18, 2025 22:10
@mroeschke mroeschke requested review from TomAugspurger and vyasr June 18, 2025 22:10
@mroeschke mroeschke added Python Affects Python cuDF API. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jun 18, 2025
@github-actions github-actions bot added the cudf-polars Issues specific to cudf-polars label Jun 18, 2025
@GPUtester GPUtester moved this to In Progress in cuDF Python Jun 18, 2025
@@ -40,6 +40,20 @@ def _create_polars_column_metadata(
return plc.interop.ColumnMetadata(name=name, children_meta=children_meta)


# This is also defined in pylibcudf.interop
class _ObjectWithArrowMetadata:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think #18722 is the primary limitation that necessitates this workaround cc @vyasr

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, exactly. Without this you lose the underlying struct fields. This solution is fine for now while we sort out #18722.

@@ -40,6 +40,20 @@ def _create_polars_column_metadata(
return plc.interop.ColumnMetadata(name=name, children_meta=children_meta)


# This is also defined in pylibcudf.interop
class _ObjectWithArrowMetadata:
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, exactly. Without this you lose the underlying struct fields. This solution is fine for now while we sort out #18722.

@mroeschke
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 925c181 into rapidsai:branch-25.08 Jun 25, 2025
91 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in cuDF Python Jun 25, 2025
@mroeschke mroeschke deleted the ref/cudf_polars/to_polars branch June 25, 2025 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cudf-polars Issues specific to cudf-polars improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants