You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.
Hi Everyone,
I'm trying to upload a pd.DataFrame to BigQuery using the datalab library, specifically the datalab.bigquery.Table.insert_data() function. The error happens when the library send the HTTP request and it has the next response:
First off: For new code we recommend that you use "import google.datalab.bigquery as bq" instead of the datalab.biquery version, and table.insert() instead of table.insert_data()
So the reason why this fails is because the numpy NaNs aren't being quoted when converted to json. Switching them to pre-quoted "NaN"s works (i.e. df = pd.DataFrame(data=[{1,2,3},{4,"NaN",6}],columns=['a','b','c'])), but it might be nice if pydatalab detected and quoted them itself.
Hi @chmeyers,
so you mean that bigquery API understood a "NaN" (str) as a "empty value"?.
and yes, it will be nice to have, but the function should give you an error, its strange that the error its given by the endpoint itself.
using dataframe = dataframe.fillna('') should fix the problem?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi Everyone,
I'm trying to upload a
pd.DataFrame
to BigQuery using thedatalab
library, specifically the datalab.bigquery.Table.insert_data() function. The error happens when the library send the HTTP request and it has the next response:the script that im using is
the library version:
thanks !
The text was updated successfully, but these errors were encountered: