InigoSJ commented on a change in pull request #15126:
URL: https://github.com/apache/beam/pull/15126#discussion_r677265181
##########
File path: sdks/python/apache_beam/io/parquetio.py
##########
@@ -64,14 +64,24 @@
class _ArrowTableToRowDictionaries(DoFn):
""" A DoFn that consumes an Arrow table and yields a python dictionary for
each row in the table."""
- def process(self, table):
+ def process(self, table, with_context=False):
+ if with_context:
+ path = table[0]
+ table = table[1]
num_rows = table.num_rows
data_items = table.to_pydict().items()
- for n in range(num_rows):
- row = {}
- for column, values in data_items:
- row[column] = values[n]
- yield row
+ if with_context:
+ for n in range(num_rows):
Review comment:
I refactored this, please let me know if that would work. Thanks
--
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]