Polber commented on code in PR #29169:
URL: https://github.com/apache/beam/pull/29169#discussion_r1375055470


##########
sdks/python/apache_beam/yaml/yaml_mapping.py:
##########
@@ -75,28 +99,89 @@ def __setstate__(self, state):
     self.__dict__.update(state)
 
 
+def row_to_dict(row):
+  if (str(type(row).__name__).startswith('BeamSchema_') or
+      isinstance(row, Row)):
+    row = row._asdict()
+  if isinstance(row, dict):
+    for key, value in row.items():
+      row[key] = row_to_dict(value)
+  elif not isinstance(row, str) and isinstance(row, Iterable):
+    row_list = list(row)
+    for idx in range(len(row_list)):

Review Comment:
   Done.



##########
sdks/python/apache_beam/yaml/yaml_mapping.py:
##########
@@ -75,28 +99,89 @@ def __setstate__(self, state):
     self.__dict__.update(state)
 
 
+def row_to_dict(row):
+  if (str(type(row).__name__).startswith('BeamSchema_') or
+      isinstance(row, Row)):
+    row = row._asdict()
+  if isinstance(row, dict):
+    for key, value in row.items():
+      row[key] = row_to_dict(value)
+  elif not isinstance(row, str) and isinstance(row, Iterable):
+    row_list = list(row)

Review Comment:
   Fixed.



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