[ 
https://issues.apache.org/jira/browse/BEAM-6769?focusedWorklogId=221783&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-221783
 ]

ASF GitHub Bot logged work on BEAM-6769:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Apr/19 15:05
            Start Date: 02/Apr/19 15:05
    Worklog Time Spent: 10m 
      Work Description: Juta commented on pull request #8056: [BEAM-6769] add 
it test for writing with bigquery io
URL: https://github.com/apache/beam/pull/8056#discussion_r271353762
 
 

 ##########
 File path: sdks/python/apache_beam/io/gcp/tests/bigquery_matcher.py
 ##########
 @@ -130,7 +130,7 @@ def __init__(self, project, query, data):
 
     self.project = project
     self.query = query
-    self.expected_data = [sorted(i) for i in data]
 
 Review comment:
   The current behavior of the bigquery_matcher is to compare data retrieved 
from bigquery by sorting both the list of rows (L146) but also the values in a 
row.  This gave an error in python 3 `TypeError: unorderable types` when 
multiple types were present in a row e.g. when `data` is `('a',1)`. I removed 
the sorting because I think it does not make sense to order the values within a 
bigquery row
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 221783)
    Time Spent: 3h 40m  (was: 3.5h)

> BigQuery IO does not support bytes in Python 3
> ----------------------------------------------
>
>                 Key: BEAM-6769
>                 URL: https://issues.apache.org/jira/browse/BEAM-6769
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>            Reporter: Juta Staes
>            Assignee: Juta Staes
>            Priority: Major
>          Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> In Python 2 you could write bytes data to BigQuery. This is tested in
>  
> [https://github.com/apache/beam/blob/master/sdks/python/apache_beam/io/gcp/big_query_query_to_table_it_test.py#L186]
> Python 3 does not support
> {noformat}
> json.dumps({'test': b'test'}){noformat}
> which is used to encode the data in
>  
> [https://github.com/apache/beam/blob/master/sdks/python/apache_beam/io/gcp/bigquery_tools.py#L959]
>  
> How should writing bytes to BigQuery be handled in Python 3?
>  * Forbid writing bytes into BigQuery on Python 3
>  * Guess the encoding (utf-8?)
>  * Pass the encoding to BigQuery
> cc: [~tvalentyn]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to