Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nullable numeric column does not handled well #719

Open
codingskynet opened this issue Jan 5, 2024 · 2 comments · May be fixed by #768
Open

nullable numeric column does not handled well #719

codingskynet opened this issue Jan 5, 2024 · 2 comments · May be fixed by #768
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery-pandas API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@codingskynet
Copy link

codingskynet commented Jan 5, 2024

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":

If you are still having issues, please be sure to include as much information as possible:

Environment details

  • pandas-gbq version: 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,
)
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-pandas API. label Jan 5, 2024
@Linchin Linchin self-assigned this Apr 30, 2024
@Linchin Linchin added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Apr 30, 2024
@Linchin Linchin added priority: p3 Desirable enhancement or fix. May not be included in next release. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. labels May 7, 2024
@Linchin
Copy link
Contributor

Linchin commented May 8, 2024

Thank you @codingskynet for raising the issue. Just so I can reproduce the exact issue, could you give me an example of:

  1. the dataframe you are trying to load
  2. the error message you get

@codingskynet
Copy link
Author

codingskynet commented May 9, 2024

I remembered that this code always tries to cast into decimal.Decimal, so if the value is None, it does not work.

@Linchin Linchin linked a pull request May 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-pandas API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants