robertwb commented on code in PR #32342:
URL: https://github.com/apache/beam/pull/32342#discussion_r1733467285


##########
sdks/python/apache_beam/yaml/yaml_io.py:
##########
@@ -259,7 +259,7 @@ def _create_formatter(
     field_names = [field.name for field in beam_schema.fields]
     if len(field_names) != 1:
       raise ValueError(f'Expecting exactly one field, found {field_names}')
-    return lambda row: getattr(row, field_names[0])
+    return lambda row: getattr(row, field_names[0]).encode('utf-8')

Review Comment:
   Should we only do this for string types? (E.g. if it's already bytes, should 
we leave it alone?)
   
   Should we provide a good error for non-string-bytes fields? (Ideally checked 
at construction time when possible?) 



-- 
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