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 was archived by the owner on Mar 6, 2026. It is now read-only.
fromgoogle.cloudimportbigqueryimportpandasaspd# Construct a BigQuery client object.client=bigquery.Client()
# TODO(developer): Set table_id to the ID of the table to create.table_id="{project_id}.{dataset_id}.{table_id}"df=pd.read_csv("data.csv")
print (df.dtypes)
df=df.astype(str)
print (df.dtypes)
print(df)
job_config=bigquery.LoadJobConfig(
write_disposition="WRITE_TRUNCATE",
)
job=client.load_table_from_dataframe(
df, table_id, job_config=job_config
) # Make an API request.job.result() # Wait for the job to complete.
Stack trace
data.csv
# example
col_a,col_b,col_c
a,,
aa,bb,cc
aaa,,ccc
it is show
col_a col_b col_c
0 a nan nan
1 aa bb cc
2 aaa nan ccc
on bq show
col_a col_b col_c
a nan nan
aa bb cc
aaa nan ccc
i think data on bq will show
col_a col_b col_c
a null null
aa bb cc
aaa null ccc
ps if data is dtypes object and value NaN . it is work