BigQuery seems to automatically convert STRING to BYTES if STRING > 186 bytes #1563
Labels
api: bigquery
Issues related to the googleapis/python-bigquery API.
priority: p3
Desirable enhancement or fix. May not be included in next release.
Environment details
google-cloud-bigquery
version: 3.8.0, 3.9.0, 3.10.0Steps to reproduce
See the code sample below. Loading a string > 186 bytes to a STRING column raises the following exception:
google.api_core.exceptions.BadRequest: 400 Provided Schema does not match Table. Field longstring has changed type from STRING to BYTES
Code example
Stack trace
UPDATE: After some more debugging, I'm starting to believe that this is a bug of the
load_table_from_json()
method. Replacing this method by a call toinsert_rows_json()
did it for me:The text was updated successfully, but these errors were encountered: