nikie commented on a change in pull request #15126:
URL: https://github.com/apache/beam/pull/15126#discussion_r687071732



##########
File path: sdks/python/apache_beam/io/filebasedsource.py
##########
@@ -377,8 +382,12 @@ def process(self, element, *args, **kwargs):
     if not source_list:
       return
     source = source_list[0].source
-    for record in source.read(range.new_tracker()):
-      yield record
+
+    if self._with_filename:
+      return [(metadata.path, record)
+              for record in source.read(range.new_tracker())]
+    else:
+      return [record for record in source.read(range.new_tracker())]

Review comment:
       Why are we changing yield to returning a list for the existing use case 
(without filename). Does this provide any advantages?




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