ValueError encountered when to_dataframe returns empty resultset with JSON field #1580
Labels
api: bigquery
Issues related to the googleapis/python-bigquery API.
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
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
Steps to reproduce
When bigquery return empty datase. bigquery python sdk will need to transfer [bq schema to arrow schema
https://github.com/googleapis/python-bigquery/blob/main/google/cloud/bigquery/table.py#L1844-L1853),
so it will execute bq_to_arrow_data_type
https://github.com/googleapis/python-bigquery/blob/main/google/cloud/bigquery/_pandas_helpers.py#L225-L246
Looks like currently this no JSON type mapping]:
https://github.com/googleapis/python-bigquery/blob/main/google/cloud/bigquery/_pandas_helpers.py#L147-L162)
Code example
Python version: Python 3.9.0
package version:
google-cloud-bigquery 3.10.0
google-cloud-bigquery-storage 2.19.1
pyarrow 8.0.0
pandas 1.5.3
How to reproduce?
test_bq.py
python test_bq.py
Created table gdw-dev-gdml.abehsu.reproduce_issue
Stack trace
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!
The text was updated successfully, but these errors were encountered: