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

Cannot convert empty datafusion dataframe to pandas #234

Closed
simicd opened this issue Feb 25, 2023 · 0 comments · Fixed by #236
Closed

Cannot convert empty datafusion dataframe to pandas #234

simicd opened this issue Feb 25, 2023 · 0 comments · Fixed by #236
Labels
bug Something isn't working

Comments

@simicd
Copy link
Contributor

simicd commented Feb 25, 2023

Describe the bug
The previously introduced to_pandas() dataframe method works only if there are 1 or more record batches. If a datafusion dataframe is empty the method will return an error instead of an empty pandas DataFrame. This error was raised by @krzysztof-kwitt in #197

To Reproduce
df.limit(0).to_pandas() fails with an error.

Expected behavior
Empty pandas dataframe

Additional context
Fix: Pass record batch schema into the arrow Table class resolves this issue.

@simicd simicd added the bug Something isn't working label Feb 25, 2023
This was referenced Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant