I'm trying to import my pandas dataframe to BigQuery, but always that I try the code insert more rows when I want to overwrite it.
client = bigquery.Client()
table_id = 'getdata-345817.get_data.fbinsights'
write_disposition = 'WRITE_TRUNCATE'
job = client.load_table_from_dataframe(
df, table_id
)
job.result()
table = client.get_table(table_id)
print(
"Loaded {} rows and {} columns to {}".format(
table.num_rows, len(table.schema), table_id
)
)
I've tried "write_truncate" but can't solve it.