robertwb commented on a change in pull request #12352:
URL: https://github.com/apache/beam/pull/12352#discussion_r473415998



##########
File path: sdks/python/apache_beam/examples/snippets/snippets.py
##########
@@ -689,8 +689,9 @@ def examples_wordcount_streaming(argv):
 
     output = (
         lines
-        | 'DecodeUnicode' >>
-        beam.FlatMap(lambda encoded: encoded.decode('utf-8'))
+        | 'DecodeUnicode' >> beam.FlatMap(
+            lambda encoded:
+            (encoded if isinstance(encoded, list) else 
encoded.decode('utf-8')))

Review comment:
       This should be changed to `beam.Map(lambda encoded: 
encoded.decode('utf-8'))` and the test values below changed back to bytes. 




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


Reply via email to