Skip to content

feat(rust)!: removed lossy type coercion for primitive numeric types …#27197

Draft
dhvish wants to merge 1 commit intopola-rs:mainfrom
dhvish:lossless_is_in
Draft

feat(rust)!: removed lossy type coercion for primitive numeric types …#27197
dhvish wants to merge 1 commit intopola-rs:mainfrom
dhvish:lossless_is_in

Conversation

@dhvish
Copy link
Copy Markdown

@dhvish dhvish commented Apr 6, 2026

…(#25624)

From what I understand, is_in currently falls back to lossy supertype conversion with try_get_supertype if the lossless upcast ( get_numeric_upcast_supertype_lossless ) doesn't work.

I made these assumptions in my changes to resolve_is_in

  • return an error if no lossless supertype exists for the two primitive numerics.
  • kept the existing Null behavior with try_get_supertype.
  • removed the a != b branch since the a == b match arm ensures that a != b will always be true (right?).

Let me know if this aligns with the intended direction. I'll fix stale/add tests for this once I get the confirmation.

Currently these tests fail. Most of these make sense as they involve lossy numeric casting.

image

@github-actions github-actions bot added breaking Change that breaks backwards compatibility enhancement New feature or an improvement of an existing feature rust Related to Rust Polars first-contribution First contribution by user title needs formatting labels Apr 6, 2026
@orlp
Copy link
Copy Markdown
Member

orlp commented Apr 7, 2026

The operation should still be supported, but be done properly. The lack of a good supertype is no excuse.

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

Labels

breaking Change that breaks backwards compatibility enhancement New feature or an improvement of an existing feature first-contribution First contribution by user rust Related to Rust Polars title needs formatting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants