You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/07/21 17:57:53 UTC

[GitHub] [beam] piotr-szuberski commented on a change in pull request #12324: [BEAM-7996] Add support for BYTES and BOOL in Python RowCoder

piotr-szuberski commented on a change in pull request #12324:
URL: https://github.com/apache/beam/pull/12324#discussion_r458285460



##########
File path: sdks/python/apache_beam/coders/standard_coders_test.py
##########
@@ -81,7 +81,10 @@ def attribute_parser_from_type(type_):
     # TODO: This should be exhaustive
     type_info = type_.WhichOneof("type_info")
     if type_info == "atomic_type":
-      return schemas.ATOMIC_TYPE_TO_PRIMITIVE[type_.atomic_type]
+      if type_.atomic_type == schema_pb2.BYTES:
+        return lambda x: x.encode("utf-8")

Review comment:
       As I understand we can't use the result of ATOMIC_TYPE_TO_PRIMITIVE[schema_pb2.BYTES] because it would result in `x = bytes('abc')` which would raise an error?




----------------------------------------------------------------
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:
users@infra.apache.org