(Go: >> BACK << -|- >> HOME <<)

Skip to content
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

Require fixed width types for casting in cudf-polars #16381

Open
wants to merge 4 commits into
base: branch-24.08
Choose a base branch
from

Conversation

brandon-b-miller
Copy link
Contributor

Fixes a bug where numeric <-> string casts are not being properly rejected at the cudf-polars level.

@brandon-b-miller brandon-b-miller added bug Something isn't working Python Affects Python cuDF API. non-breaking Non-breaking change cudf.polars Issues specific to cudf.polars labels Jul 24, 2024
@brandon-b-miller brandon-b-miller requested a review from a team as a code owner July 24, 2024 15:10
Copy link
Contributor
@wence- wence- left a comment

Choose a reason for hiding this comment

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

I think the logic is not right, sorry

python/cudf_polars/cudf_polars/dsl/expr.py Outdated Show resolved Hide resolved
@vyasr
Copy link
Contributor
vyasr commented Jul 25, 2024

@brandon-b-miller it looks like the new code path in this test is not fully being exercised. If I had to guess, it's because the condition is short-circuiting so some of the later conditions are never being evaluated (i.e. you don't reach is_supported_cast if both is_fixed_width tests fail).

@brandon-b-miller
Copy link
Contributor Author

@brandon-b-miller it looks like the new code path in this test is not fully being exercised. If I had to guess, it's because the condition is short-circuiting so some of the later conditions are never being evaluated (i.e. you don't reach is_supported_cast if both is_fixed_width tests fail).

This was subtle but it came down to a failed StringFunction.Contains test:

  • the plan inserting a cast to string on the argument passed to contains (in this case an int->string cast)
  • the existing code failing to reject this cast when setting up the test data and allowing the test to proceed and hit the NotImplementedError in contains that coverage now complains we miss
  • The code still raising NotImplementedError eventually causing the test to pass both ways

@vyasr
Copy link
Contributor
vyasr commented Jul 25, 2024

Nice find! That seems to have done the trick.

@vyasr vyasr requested a review from wence- July 25, 2024 03:24
@vyasr
Copy link
Contributor
vyasr commented Jul 25, 2024

I'll leave this for @wence- to re-review and merge in the morning, but hopefully this is all set now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cudf.polars Issues specific to cudf.polars non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

None yet

3 participants