You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Beam JIRA Bot (Jira)" <ji...@apache.org> on 2020/08/24 17:07:01 UTC
[jira] [Commented] (BEAM-10314) Writing containers containing
nested Decimal to BigQuery fails
[ https://issues.apache.org/jira/browse/BEAM-10314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17183465#comment-17183465 ]
Beam JIRA Bot commented on BEAM-10314:
--------------------------------------
This issue is P2 but has been unassigned without any comment for 60 days so it has been labeled "stale-P2". If this issue is still affecting you, we care! Please comment and remove the label. Otherwise, in 14 days the issue will be moved to P3.
Please see https://beam.apache.org/contribute/jira-priorities/ for a detailed explanation of what these priorities mean.
> Writing containers containing nested Decimal to BigQuery fails
> --------------------------------------------------------------
>
> Key: BEAM-10314
> URL: https://issues.apache.org/jira/browse/BEAM-10314
> Project: Beam
> Issue Type: Bug
> Components: io-py-gcp
> Reporter: Alexander Faxå
> Priority: P2
> Labels: stale-P2
>
> This piece of code: [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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)