-
Notifications
You must be signed in to change notification settings - Fork 590
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
Support summarization of empty data in Pandas backend #2908
Support summarization of empty data in Pandas backend #2908
Conversation
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.
lgtm
ibis/expr/schema.py
Outdated
| series = [data.apply(lambda t: t[i]) for i in range(num_cols)] | ||
| result = pd.concat(series, axis=1) | ||
| if not len(data): | ||
| result = pd.concat([data], axis=1) |
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.
Why not result = data.to_frame()?
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.
Good point, updated to use to_frame instead.
f6ae051
to
614344e
Compare
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.
LGTM
|
Thanks @emilyreff7 |
Proposed Change
Handle empty input data in summarization.
Currently, when a summarization gets passed empty data in the Pandas backend, we error out with a confusing
This PR adds checks in a couple of places for empty data, such that we gracefully return an empty DataFrame instead.
Tests
Added a new test for this in test_vectorized_udf.py.