robertwb commented on code in PR #31427:
URL: https://github.com/apache/beam/pull/31427#discussion_r1617930991


##########
sdks/python/apache_beam/yaml/yaml_mapping.py:
##########
@@ -276,12 +277,19 @@ def _as_callable_for_pcoll(
   if isinstance(fn_spec, str) and fn_spec in input_schema:
     return lambda row: getattr(row, fn_spec)
   else:
-    return _as_callable(list(input_schema.keys()), fn_spec, msg, language)
+    return _as_callable(
+        list(input_schema.keys()), fn_spec, msg, language, input_schema)
 
 
-def _as_callable(original_fields, expr, transform_name, language):
+def _as_callable(
+    original_fields, expr, transform_name, language, input_schema=None):
+
+  # Extract original type from upstream pcoll when doing simple mappings
+  if input_schema is None:
+    input_schema = {}
+  original_type = input_schema.get(transform_name, None)

Review Comment:
   I'm not quite understanding why you want to use `transform_name` as a key in 
the input schema here.



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