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

fix: Fix one edge case (out of many) of int128 literals not working #20830

Merged
merged 7 commits into from
Jan 22, 2025

Conversation

itamarst
Copy link
Contributor

@itamarst itamarst commented Jan 21, 2025

Fixes #20807

See also #20829 for related issues that also seem like they need fixing.

@itamarst itamarst changed the title bug(py): Fix one edge case (out of many) of int128 literals not working fix: Fix one edge case (out of many) of int128 literals not working Jan 21, 2025
@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars and removed title needs formatting labels Jan 21, 2025
@itamarst
Copy link
Contributor Author

The test failure doesn't seem to be related to this PR?

@itamarst itamarst marked this pull request as ready for review January 21, 2025 17:27
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.70%. Comparing base (099ee3c) to head (19588b8).
Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20830      +/-   ##
==========================================
+ Coverage   79.63%   79.70%   +0.06%     
==========================================
  Files        1568     1569       +1     
  Lines      222970   223020      +50     
  Branches     2544     2546       +2     
==========================================
+ Hits       177555   177748     +193     
+ Misses      44831    44688     -143     
  Partials      584      584              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

}
#[cfg(feature = "dtype-i128")]
{
AnyValue::Int128(v)
Copy link
Member

Choose a reason for hiding this comment

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

Can we still do a i128::try_from. Python has unbounded integers.

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 did that initially, and then the compiler pointed out that v is i128 so the try_from() always succeeds and is redundant. So at the local scope the current code is the correct thing to do I think?

Copy link
Member

Choose a reason for hiding this comment

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

Ah.. right. 👍

@ritchie46 ritchie46 merged commit f79ea83 into pola-rs:main Jan 22, 2025
28 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: series.index_of returns None for 2*66 with pl.Int128
3 participants