Skip to content

Commit 36e531f

Browse files
committed
remove code change and just have tests
1 parent 54a54d3 commit 36e531f

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

sdks/python/apache_beam/yaml/yaml_transform.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,19 +1034,6 @@ def preprocess_windowing(spec):
10341034
spec['config'] = spec.get('config', {})
10351035
spec['config']['windowing'] = spec.pop('windowing')
10361036

1037-
if spec.get('config', {}).get('windowing'):
1038-
windowing_config = spec['config']['windowing']
1039-
if isinstance(windowing_config, str):
1040-
try:
1041-
# PyYAML can load a JSON string.
1042-
parsed_config = yaml.safe_load(windowing_config)
1043-
if not isinstance(parsed_config, dict):
1044-
raise TypeError('Windowing config string must be a YAML/JSON map.')
1045-
spec['config']['windowing'] = parsed_config
1046-
except Exception as e:
1047-
raise ValueError(
1048-
f'Error parsing windowing config string at \
1049-
{identify_object(spec)}: {e}') from e
10501037
return spec
10511038
elif 'windowing' not in spec:
10521039
# Nothing to do.

sdks/python/apache_beam/yaml/yaml_transform_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,8 +1005,7 @@ def test_explicit_window_into_with_json_string_config(self):
10051005
elements: [0, 1, 2, 3, 4, 5]
10061006
- type: WindowInto
10071007
config:
1008-
windowing: |
1009-
{"type": "fixed", "size": "4s"}
1008+
windowing: {"type": "fixed", "size": "4s"}
10101009
- type: SumGlobally
10111010
''',
10121011
providers=TEST_PROVIDERS)

0 commit comments

Comments
 (0)