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


##########
sdks/python/apache_beam/yaml/yaml_mapping.py:
##########
@@ -616,6 +617,13 @@ def _PyJsFilter(
 
   See more complete documentation on
   [YAML 
Filtering](https://beam.apache.org/documentation/sdks/yaml-udf/#filtering).
+
+  Args:
+    keep: An expression evaluating to true for those records that should be 
kept.
+    language: The language of the above expression.
+      Defaults to generic.
+    error_handling: (Optional) Whether and where to output records that throw 
errors when
+      the above expressions are evaluated.

Review Comment:
   #33060 will make it so that all instances of error_handling are treated as 
Optional (so in this case, it would be printed twice)
   ```suggestion
       error_handling: Whether and where to output records that throw errors 
when
         the above expressions are evaluated.
   ```



##########
sdks/python/apache_beam/yaml/yaml_mapping.py:
##########
@@ -661,14 +669,32 @@ def normalize_fields(pcoll, fields, drop=(), 
append=False, language='generic'):
 
 @beam.ptransform.ptransform_fn
 @maybe_with_exception_handling_transform_fn
-def _PyJsMapToFields(pcoll, language='generic', **mapping_args):
+def _PyJsMapToFields(
+    pcoll,
+    fields: Mapping[str, Union[str, Mapping[str, str]]],
+    append: bool = False,
+    drop: Iterable[str] = (),
+    language: str = 'generic'):
   """Creates records with new fields defined in terms of the input fields.
 
   See more complete documentation on
   [YAML Mapping 
Functions](https://beam.apache.org/documentation/sdks/yaml-udf/#mapping-functions).
+
+  Args:
+    fields: The output fields to compute, each mapping to the expression or
+      callable that creates them.
+    append: (Optional) Whether to append the created fields to the set of
+      fields already present, outputting a union of both the new fields and
+      the original fields for each record.  Defaults to False.
+    drop: (Optional) If `append` is true, enumerates a subset of fields from 
the
+      original record that should not be kept
+    language: (Optional) The language used to define (and execute) the
+      expressions and/or callables in `fields`. Defaults to generic.
+    error_handling: (Optional) Whether and where to output records that throw 
errors when

Review Comment:
   The `(Optional)` tags should already be added by `generate_yaml_docs` since 
all these args have default values (which would cause it to get printed twice)



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