python-bigquery-pandas
python-bigquery-pandas copied to clipboard
nullable numeric column does not handled well
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
Please run down the following list and make sure you've tried the usual "quick fixes":
- Search the issues already opened: https://github.com/googleapis/python-bigquery-pandas/issues
- Search StackOverflow: https://stackoverflow.com/questions/tagged/google-cloud-platform+python
If you are still having issues, please be sure to include as much information as possible:
Environment details
pandas-gbqversion: 0.19.2
Steps to reproduce
Try to_gbq with nullable Decimal rows. It does not handle None or pd.NA since it always tries to cast value into Decimal whatever it is None or not: https://github.com/googleapis/python-bigquery-pandas/blob/main/pandas_gbq/load.py#L61-L109
Code example
df = pd.DataFrame(results)
df.to_gbq(
'table,
'namespace',
if_exists='append',
credentials=credentials,
)