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

ZeroDivisionError on uploading empty dataframe #237

Closed
knowsuchagency opened this issue Dec 1, 2018 · 3 comments
Closed

ZeroDivisionError on uploading empty dataframe #237

knowsuchagency opened this issue Dec 1, 2018 · 3 comments
Assignees
Labels
accepting pull requests type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@knowsuchagency
Copy link

Attempting to upload an empty dataframe seems to raise to a ZeroDivisionError in version 0.8.0

[2018-12-01 09:40:32,542] {base_task_runner.py:95} INFO - Subtask:   File "/usr/local/lib/python2.7/site-packages/pandas_gbq/gbq.py", line 509, in load_data
[2018-12-01 09:40:32,542] {base_task_runner.py:95} INFO - Subtask:     ((total_rows - remaining_rows) * 100) / total_rows
[2018-12-01 09:40:32,542] {base_task_runner.py:95} INFO - Subtask: ZeroDivisionError: integer division or modulo by zero
@max-sixty
Copy link
Contributor

Thanks. Would def take a PR for this.

@tswast tswast added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. accepting pull requests labels Dec 19, 2018
@tswast
Copy link
Collaborator

tswast commented Mar 4, 2019

Closed by #252.

Will be fixed in the 0.10.0 release.

@tswast tswast closed this as completed Mar 4, 2019
@tswast tswast reopened this Mar 9, 2019
@tswast
Copy link
Collaborator

tswast commented Mar 9, 2019

Not entirely fixed yet, as I noted in https://github.com/pydata/pandas-gbq/pull/252/files#r263975138 the load job can fail when a DataFrame contains no rows and no columns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting pull requests type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants