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

refactor(python): Expose group_by_dynamic in pyir #19385

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

wence-
Copy link
Collaborator

@wence- wence- commented Oct 22, 2024

Previously we were just ignoring this, which meant we would sometimes fail to fall back correctly in the GPU engine.

@github-actions github-actions bot added internal An internal refactor or improvement python Related to Python Polars labels Oct 22, 2024
Copy link

codecov bot commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 4.34783% with 66 lines in your changes missing coverage. Please review.

Project coverage is 80.17%. Comparing base (fc8eec2) to head (7eea93c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../polars-python/src/lazyframe/visitor/expr_nodes.rs 0.00% 55 Missing ⚠️
crates/polars-time/src/windows/group_by.rs 0.00% 3 Missing ⚠️
...rates/polars-python/src/lazyframe/visitor/nodes.rs 50.00% 2 Missing ⚠️
...s-arrow/src/legacy/kernels/rolling/no_nulls/mod.rs 0.00% 1 Missing ⚠️
crates/polars-arrow/src/legacy/kernels/time.rs 0.00% 1 Missing ⚠️
crates/polars-core/src/frame/mod.rs 0.00% 1 Missing ⚠️
crates/polars-ops/src/series/ops/is_between.rs 0.00% 1 Missing ⚠️
...rates/polars-plan/src/dsl/function_expr/bitwise.rs 0.00% 1 Missing ⚠️
crates/polars-plan/src/dsl/options.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #19385   +/-   ##
=======================================
  Coverage   80.17%   80.17%           
=======================================
  Files        1528     1528           
  Lines      210325   210327    +2     
  Branches     2440     2440           
=======================================
+ Hits       168619   168631   +12     
+ Misses      41151    41141   -10     
  Partials      555      555           

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


#[getter]
fn label(&self, py: Python<'_>) -> PyResult<PyObject> {
let result = match self.inner.label {
Copy link
Member

Choose a reason for hiding this comment

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

We can tag Label with #[derive(IntoStaticStr)]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

question: I did not know about this derive macro previously, so there are a bunch of cases where I do this match dance. Is it worth tagging all those enums in polars with IntoStaticStr and then using this pattern here? This will be a breaking change (not a big deal) in the IR, since the names will change their case-pattern. e.g. StartBy, not start_by.

Copy link
Member

Choose a reason for hiding this comment

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

We can even control the output with those macros. I believe #[strum(serialize_all = "snake_case")], see: https://docs.rs/strum/latest/strum/additional_attributes/index.html

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, even better. I'll try with that and see if anything breaks locally.

@wence- wence- force-pushed the wence/fea/dynamic-groupby-pyir branch from f3ee681 to 324c7ff Compare October 23, 2024 13:16
Previously we were just ignoring this, which meant we would sometimes
fail to fall back correctly in the GPU engine.
@wence-
Copy link
Collaborator Author

wence- commented Oct 23, 2024

FWIW, would be good to get this into 1.11

@wence- wence- force-pushed the wence/fea/dynamic-groupby-pyir branch from 324c7ff to 7eea93c Compare October 23, 2024 14:32
@wence- wence- marked this pull request as ready for review October 23, 2024 14:32
@@ -57,7 +57,7 @@ impl NodeTraverser {
// Increment major on breaking changes to the IR (e.g. renaming
// fields, reordering tuples), minor on backwards compatible
// changes (e.g. exposing a new expression node).
const VERSION: Version = (2, 3);
const VERSION: Version = (3, 0);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

join type of "leftsemi"/"leftanti" turned into "semi"/"anti"

@ritchie46
Copy link
Member

It will make 1.11 :)

@ritchie46 ritchie46 merged commit fe016ed into pola-rs:main Oct 23, 2024
20 checks passed
@wence- wence- deleted the wence/fea/dynamic-groupby-pyir branch October 23, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants