Skip to content

Commit

Permalink
fixup: format fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mravi committed Nov 25, 2024
1 parent 4892851 commit 1f5dd82
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions sdks/python/apache_beam/yaml/yaml_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,8 +976,8 @@ def validate_transform_references(spec):
for input_value in input_values:
if isinstance(input_value, str) and input_value.lower() == name.lower():
raise ValueError(
f"Circular reference detected: Transform {name} "
f"references itself as input in {identify_object(transform)}")
f"Circular reference detected: Transform {name} "
f"references itself as input in {identify_object(transform)}")

return spec

Expand Down
11 changes: 6 additions & 5 deletions sdks/python/apache_beam/yaml/yaml_transform_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def test_csv_to_json(self):

def test_circular_reference_validation(self):
with beam.Pipeline(options=beam.options.pipeline_options.PipelineOptions(
pickle_library='cloudpickle')) as p:
pickle_library='cloudpickle')) as p:
# pylint: disable=expression-not-assigned
with self.assertRaisesRegex(ValueError, r'Circular reference detected.*'):
p | YamlTransform(
Expand All @@ -280,15 +280,15 @@ def test_circular_reference_validation(self):
input: Create
output: PyMap
''',
providers=TEST_PROVIDERS)
providers=TEST_PROVIDERS)

def test_circular_reference_multi_inputs_validation(self):
with beam.Pipeline(options=beam.options.pipeline_options.PipelineOptions(
pickle_library='cloudpickle')) as p:
pickle_library='cloudpickle')) as p:
# pylint: disable=expression-not-assigned
with self.assertRaisesRegex(ValueError, r'Circular reference detected.*'):
p | YamlTransform(
'''
'''
type: composite
transforms:
- type: Create
Expand All @@ -301,7 +301,8 @@ def test_circular_reference_multi_inputs_validation(self):
fn: "lambda row: row.element * row.element"
input: [Create, PyMap]
output: PyMap
''', providers=TEST_PROVIDERS)
''',
providers=TEST_PROVIDERS)

def test_name_is_not_ambiguous(self):
with beam.Pipeline(options=beam.options.pipeline_options.PipelineOptions(
Expand Down

0 comments on commit 1f5dd82

Please sign in to comment.