Skip to content
Merged
Changes from all commits
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
37 changes: 17 additions & 20 deletions sdks/python/apache_beam/yaml/yaml_transform_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,10 @@ def test_csv_to_json(self):
pd.testing.assert_frame_equal(data, result)

def test_circular_reference_validation(self):
with beam.Pipeline(options=beam.options.pipeline_options.PipelineOptions(
pickle_library='cloudpickle')) as p:
# pylint: disable=expression-not-assigned
with self.assertRaisesRegex(ValueError, r'Circular reference detected.*'):
p | YamlTransform(
with self.assertRaisesRegex(ValueError, r'Circular reference detected.*'):
with beam.Pipeline(options=beam.options.pipeline_options.PipelineOptions(
pickle_library='cloudpickle')) as p:
_ = p | YamlTransform(
'''
type: composite
transforms:
Expand All @@ -318,11 +317,10 @@ def test_circular_reference_validation(self):
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:
# pylint: disable=expression-not-assigned
with self.assertRaisesRegex(ValueError, r'Circular reference detected.*'):
p | YamlTransform(
with self.assertRaisesRegex(ValueError, r'Circular reference detected.*'):
with beam.Pipeline(options=beam.options.pipeline_options.PipelineOptions(
pickle_library='cloudpickle')) as p:
_ = p | YamlTransform(
'''
type: composite
transforms:
Expand Down Expand Up @@ -362,11 +360,10 @@ def test_name_is_not_ambiguous(self):
assert_that(result, equal_to([0, 1, 9, 16]))

def test_name_is_ambiguous(self):
with beam.Pipeline(options=beam.options.pipeline_options.PipelineOptions(
pickle_library='cloudpickle')) as p:
# pylint: disable=expression-not-assigned
with self.assertRaisesRegex(ValueError, r'Circular reference detected.*'):
p | YamlTransform(
with self.assertRaisesRegex(ValueError, r'Circular reference detected.*'):
with beam.Pipeline(options=beam.options.pipeline_options.PipelineOptions(
pickle_library='cloudpickle')) as p:
_ = p | YamlTransform(
'''
type: composite
transforms:
Expand All @@ -389,11 +386,11 @@ def test_name_is_ambiguous(self):
providers=TEST_PROVIDERS)

def test_empty_inputs_throws_error(self):
with beam.Pipeline(options=beam.options.pipeline_options.PipelineOptions(
pickle_library='cloudpickle')) as p:
with self.assertRaisesRegex(ValueError,
'Missing inputs for transform at '
'"EmptyInputOkButYamlDoesntKnow" at line .*'):
with self.assertRaisesRegex(ValueError,
'Missing inputs for transform at '
'"EmptyInputOkButYamlDoesntKnow" at line .*'):
with beam.Pipeline(options=beam.options.pipeline_options.PipelineOptions(
pickle_library='cloudpickle')) as p:
_ = p | YamlTransform(
'''
type: composite
Expand Down
Loading