damccorm opened a new issue, #20439:
URL: https://github.com/apache/beam/issues/20439

   This piece of code: 
[https://github.com/apache/beam/blob/master/sdks/python/apache_beam/io/gcp/bigquery_tools.py#L946](https://github.com/apache/beam/blob/master/sdks/python/apache_beam/io/gcp/bigquery_tools.py#L946)
 is attempting to handle the case when inserting objects of type 
decimal.Decimal into BigQuery by converting them to string.
   
   This works but doesn't handle the case when the `v` is really a container of 
nested objects (e.g. a dict), and one of them is a decimal.Decimal. This can 
easily happen when using ReadFromBigQuery on a table with nested schema.
   
   Note how `to_json_value`, which is being called here, is recursive for this 
reason. I verified that a fix for my crash is to insert
   
   ```
   
   if isinstance(obj, decimal.Decimal):
     obj = str(obj)
   
   ```
   
   in the beginning of to_json_value.
   
   Imported from Jira 
[BEAM-10314](https://issues.apache.org/jira/browse/BEAM-10314). Original Jira 
may contain additional context.
   Reported by: alexanderfaxa.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to