Polber commented on code in PR #32342:
URL: https://github.com/apache/beam/pull/32342#discussion_r1733487697
##########
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:
@robertwb I went a different direction and instead try to cast object to
string, failing if it cannot be done.
Not sure how to best check input type - and what would be considered not
compatible? Should we fail a pipeline that is trying to write an integer which
can easily be cast to string?
--
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]