Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[yaml] various inline provider doc fixes #33296

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sdks/python/apache_beam/yaml/yaml_combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ class PyJsYamlCombine(beam.PTransform):

See also the documentation on
[YAML Aggregation](https://beam.apache.org/documentation/sdks/yaml-combine/).

Args:
group_by: The field to aggregate on.
robertwb marked this conversation as resolved.
Show resolved Hide resolved
combine: The aggregation function to use.
language: The language used to define (and execute) the
custom callables in `combine`. Defaults to generic.
"""
def __init__(
self,
Expand Down
29 changes: 16 additions & 13 deletions sdks/python/apache_beam/yaml/yaml_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,19 +428,19 @@ class _StripErrorMetadata(beam.PTransform):

For example, in the following pipeline snippet::

- name: MyMappingTransform
type: MapToFields
input: SomeInput
config:
language: python
fields:
...
error_handling:
output: errors

- name: RecoverOriginalElements
type: StripErrorMetadata
input: MyMappingTransform.errors
- name: MyMappingTransform
type: MapToFields
input: SomeInput
config:
language: python
fields:
...
error_handling:
output: errors

- name: RecoverOriginalElements
type: StripErrorMetadata
input: MyMappingTransform.errors

the output of `RecoverOriginalElements` will contain exactly those elements
from SomeInput that failed to processes (whereas `MyMappingTransform.errors`
Expand All @@ -453,6 +453,9 @@ class _StripErrorMetadata(beam.PTransform):

_ERROR_FIELD_NAMES = ('failed_row', 'element', 'record')

def __init__(self):
super().__init__(label=None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this needed?


def expand(self, pcoll):
try:
existing_fields = {
Expand Down
Loading