-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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: Categorical min/max returning String dtype rather than Categorical #21232
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21232 +/- ##
==========================================
+ Coverage 79.82% 79.89% +0.07%
==========================================
Files 1596 1596
Lines 228517 228552 +35
Branches 2608 2608
==========================================
+ Hits 182413 182604 +191
+ Misses 45508 45352 -156
Partials 596 596 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, the failures shuold be fixed on main. Can you rebase?
q = lf.select(pl.all().min()) | ||
result = q.collect() | ||
assert q.collect_schema() == lf.collect_schema() | ||
assert result.schema == lf.collect_schema() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also check that the schema contains categoricals and enums?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added more explicit check
Thanks! |
Min/max aggregations on categorical dtypes currently return string dtype. This PR changes the output to maintain the categorical dtype as is done for enums. This also aligns the output with the expected schema which was misaligned.