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

feat: Expressify n of shift #12004

Merged
merged 3 commits into from
Oct 25, 2023
Merged

feat: Expressify n of shift #12004

merged 3 commits into from
Oct 25, 2023

Conversation

reswqa
Copy link
Collaborator

@reswqa reswqa commented Oct 25, 2023

No description provided.

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels Oct 25, 2023
@@ -416,6 +416,60 @@ impl OptimizationRule for TypeCoercionRule {
options,
})
},
// shift and fill should only cast left and fill value to super type.
AExpr::Function {
function: FunctionExpr::ShiftAndFill,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This function is special as only partial inputs(left and fill_value) should cast to super type. I'm not sure, but as we continue to expressify arguments, this requirement will become more and more common, and we may need to add support for casting partial inputs in the future. 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Yes, good point. I feel that that should be an option of the FunctionOptions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, maybe change the type of cast_to_super_type to Optional<Vec>, WDYT?

@reswqa reswqa marked this pull request as ready for review October 25, 2023 06:47
@ritchie46 ritchie46 merged commit c67409b into pola-rs:main Oct 25, 2023
28 checks passed
@reswqa reswqa deleted the shift_expr_1 branch October 25, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants