diff --git a/sdks/python/apache_beam/yaml/yaml_transform.py b/sdks/python/apache_beam/yaml/yaml_transform.py index b467225d3a8..3837f28ed4e 100644 --- a/sdks/python/apache_beam/yaml/yaml_transform.py +++ b/sdks/python/apache_beam/yaml/yaml_transform.py @@ -772,8 +772,8 @@ def preprocess_windowing(spec): 'input': spec['input'], 'output': modified_spec['__uuid__'], 'config': { - 'error_handling': spec.get('config').get('error_handling', None) - } or {}, + 'error_handling': spec.get('config', {}).get('error_handling', {}) + }, '__line__': spec['__line__'], '__uuid__': spec['__uuid__'], } @@ -809,8 +809,8 @@ def preprocess_windowing(spec): 'transforms': [modified_spec] + windowing_transforms, 'output': windowed_outputs, 'config': { - 'error_handling': spec.get('config').get('error_handling', None) - } or {}, + 'error_handling': spec.get('config', {}).get('error_handling', {}) + }, '__line__': spec['__line__'], '__uuid__': spec['__uuid__'], }