For some reason, I’m unable to use pandas function pandas.DataFrame.to_gbq
(here).
I’ve been building this small example to reproduce the issue :
table_schema = [{'name':'company','type':'STRING'},
{'name':'country','type':'STRING'},
{'name':'revenue','type':'NUMERIC'},
{'name':'pageviews','type':'INTEGER'}]
dataframe = pandas.DataFrame({
'company': ['stackoverflow'],
'country': ['france'],
'revenue': [1000.23],
'pageviews': [10000]})
table_name = 'my_dataset.petit_test'
dataframe.to_gbq(table_name,
'PROJECT_ID',
chunksize=100000,
if_exists='replace',
table_schema=table_schema)
As a result, I get a big error message ending as follow:
pandas_gbq.exceptions.ConversionError: Could not convert DataFrame to Parquet.
I can’t figure out what is going wrong here.
Does anyone get the understanding ?