Skip to content

Commit

Permalink
feat(python): improve error message in struct apply (#5291)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Oct 21, 2022
1 parent 8609cdf commit 4aba79e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion py-polars/src/apply/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fn iterator_to_struct<'a>(
let dict = dict.downcast::<PyDict>()?;
if dict.len() != struct_width {
return Err(crate::error::ComputeError::new_err(
"all tuples must have equal size",
format!("Cannot create struct type.\n> The struct dtype expects {} fields, but it got a dict with {} fields.", struct_width, dict.len())
));
}
// we ignore the keys of the rest of the dicts
Expand Down

0 comments on commit 4aba79e

Please sign in to comment.