df2gspread
df2gspread copied to clipboard
fix uploading header twice if DataFrame is empty, fixes #47
returns an error if trying to upload an empty DataFrame to GSheets rather than adding two rows with the DataFrame header
Coverage decreased (-1.2%) to 28.037% when pulling 8c4da476d22ed4e994a30b4afba02d543c54ed46 on 22764636:empty_dataframe into f4cef3800704aceff2ed08a623a594b558d44898 on maybelinot:master.
Sorry for not looking closer into the issue, I think better behaviour would be to upload just columns. empty dataframe is a valid input and I don't think raising an error is correct way to handle it.
I agree it would be a better way of handling an empty dataframe however it requires quite a few amendments to your code. If you're comfortable with this I will go ahead and work on the code
Yes, I’m okay with it, ping me if something isn’t clear
I think I have fixed it, there was an issue with row_names = True if DataFrame was empty too, I should have solved both issues
However before pushing the updates want to ask if there was any particular reason you created the clean_worksheet function instead of simply calling wks.clear()? I think it is more efficient compared to calling a different function.
Hi @22764636,
Yes, there was a reason, the idea was to store multiple tables on the same worksheet and being able to clean them up individually, I'd probably want to keep that functionality
just committed a new update, see if it fits your code
Thanks, will look into it over the weekend!
On Wed, 18 Dec 2019 at 16:28, Carmine Migliore [email protected] wrote:
just committed a new update, see if it fits your code
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/maybelinot/df2gspread/pull/48?email_source=notifications&email_token=ABHYTNNLUZRCQS3L5BELWFTQZI6THA5CNFSM4JKVXTT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHGPLYI#issuecomment-567080417, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHYTNMPLKTEFEPGT42O4ULQZI6THANCNFSM4JKVXTTQ .