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

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

                Author: ASF GitHub Bot
            Created on: 19/May/20 23:25
            Start Date: 19/May/20 23:25
    Worklog Time Spent: 10m 
      Work Description: TheNeuralBit commented on a change in pull request 
#11701:
URL: https://github.com/apache/beam/pull/11701#discussion_r427655332



##########
File path: sdks/python/apache_beam/coders/row_coder.py
##########
@@ -134,19 +134,18 @@ def __init__(self, schema, components):
   def encode_to_stream(self, value, out, nested):
     nvals = len(self.schema.fields)
     self.SIZE_CODER.encode_to_stream(nvals, out, True)
-    attrs = [getattr(value, f.name) for f in self.schema.fields]

Review comment:
       Yeah that's right. Right now it should only be possible to get here with 
a NamedTuple instance, so it should be safe.
   
   Looking forward to the day where more types might go through this code.. I 
kind of like the idea of using `tuple` as the "base" schema type in Python 
(i.e. the type we must be able to convert to/from for use in row coder). 
Relying on attributes isn't great since it limits us to field names that are 
valid python identifiers.
   
   All that being said I'd be fine dropping this part of the change for now. 
Renaming the special `id` field also fixes the bug.




----------------------------------------------------------------
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: 435270)
    Time Spent: 40m  (was: 0.5h)

> Add integration tests for cross-language SnowflakeIO Read and Write
> -------------------------------------------------------------------
>
>                 Key: BEAM-9899
>                 URL: https://issues.apache.org/jira/browse/BEAM-9899
>             Project: Beam
>          Issue Type: Test
>          Components: io-ideas
>            Reporter: Dariusz Aniszewski
>            Priority: P2
>          Time Spent: 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to