-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix: Verify arr namespace is called from array column
#25650
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25650 +/- ##
==========================================
- Coverage 79.58% 79.49% -0.09%
==========================================
Files 1743 1743
Lines 240439 240455 +16
Branches 3038 3038
==========================================
- Hits 191347 191150 -197
- Misses 48310 48523 +213
Partials 782 782 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| impl<'a> FieldsMapper<'a> { | ||
| /// Validate that the dtype is a List. | ||
| pub fn ensure_is_list(self) -> PolarsResult<Self> { | ||
| let dt = self.args()[0].dtype(); | ||
| polars_ensure!( | ||
| dt.is_list(), | ||
| InvalidOperation: format!("expected List data type for list operation, got: {:?}", dt) | ||
| ); | ||
| Ok(self) | ||
| } | ||
| } | ||
|
|
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.
I moved this here since it's only ever referenced in this module, so it makes a bit more sense here. Also, we now use the debug formatting for the output datatype to better align with our polars datatypes, i.e. we now get List(Int8) instead of list[i8].
Fixes #25648.
I left out
arr.aggandarr.evalfrom the unit test because these take a separate path and have a separate error message.