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: return float dtype in interpolate (for method="linear") for numeric dtypes #11624

Merged
merged 3 commits into from
Oct 13, 2023

Conversation

MarcoGorelli
Copy link
Collaborator

@MarcoGorelli MarcoGorelli commented Oct 9, 2023

part I of addressing #11595

Not changing anything to do with method='nearest' in this one

For numeric types, I'm making it return float - but for temporal types, I'm preserving the current functionality of preserving the data type. It could return a high-resolution datetime instead, but it'd be backed by integers anyway so I'm not totally sure about whether that's a good idea

@github-actions github-actions bot added the fix Bug fix label Oct 9, 2023
@MarcoGorelli MarcoGorelli marked this pull request as ready for review October 10, 2023 11:59
@orlp
Copy link
Collaborator

orlp commented Oct 10, 2023

Can you remove linear_interp_unsigned? I believe it's unused now.

EDIT: on closer inspection, it now seems that the date types involve two casts to/from floating point? Shouldn't those be done entirely in integer land then? Perhaps the unsigned variant is still needed then.

@MarcoGorelli
Copy link
Collaborator Author

thanks for your review! yes, good point

Perhaps the unsigned variant is still needed then

The physical dtype would still be signed, so I think you're right that it wouldn't be needed

@stinodego stinodego changed the title fix(rust, python)! return float dtype in interpolate (for method="linear") for numeric dtypes fix(rust, python)!: return float dtype in interpolate (for method="linear") for numeric dtypes Oct 10, 2023
@github-actions github-actions bot added breaking Change that breaks backwards compatibility python Related to Python Polars rust Related to Rust Polars labels Oct 10, 2023
@ritchie46 ritchie46 merged commit f7374e5 into pola-rs:main Oct 13, 2023
26 checks passed
@stinodego stinodego changed the title fix(rust, python)!: return float dtype in interpolate (for method="linear") for numeric dtypes fix(rust, python): return float dtype in interpolate (for method="linear") for numeric dtypes Oct 13, 2023
@stinodego stinodego changed the title fix(rust, python): return float dtype in interpolate (for method="linear") for numeric dtypes fix: return float dtype in interpolate (for method="linear") for numeric dtypes Oct 13, 2023
@stinodego stinodego removed the breaking Change that breaks backwards compatibility label Oct 13, 2023
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.

4 participants