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



##########
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:
       Oh yeah I see. The test is wrong now, but it was also wrong before 
because it returned an output value of type `bytes`, which we now throw an 
error for in `process_outputs` of `common.py`. We had an email thread about 
this earlier which I'll send a reply to for more context.




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


Reply via email to