From 267bbf7a84bc5ae69c0bada82cf7e54873e8f2a4 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 20 Sep 2023 16:46:09 -0700 Subject: [PATCH] lint --- sdks/python/apache_beam/yaml/yaml_transform_scope_test.py | 4 +++- sdks/python/apache_beam/yaml/yaml_transform_unit_test.py | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sdks/python/apache_beam/yaml/yaml_transform_scope_test.py b/sdks/python/apache_beam/yaml/yaml_transform_scope_test.py index ed0988967e85..f00403b07e2a 100644 --- a/sdks/python/apache_beam/yaml/yaml_transform_scope_test.py +++ b/sdks/python/apache_beam/yaml/yaml_transform_scope_test.py @@ -78,7 +78,8 @@ def test_get_pcollection_output(self): "PCollection[Square.None]", str(scope.get_pcollection("LogForTesting"))) self.assertTrue( - scope.get_pcollection("Square") == scope.get_pcollection("LogForTesting")) + scope.get_pcollection("Square") == scope.get_pcollection( + "LogForTesting")) def test_create_ptransform(self): with beam.Pipeline(options=beam.options.pipeline_options.PipelineOptions( @@ -108,6 +109,7 @@ def test_create_ptransform(self): **result_annotations, **target_annotations }) + class TestProvider(yaml_provider.InlineProvider): def __init__(self, transform, name): super().__init__({ diff --git a/sdks/python/apache_beam/yaml/yaml_transform_unit_test.py b/sdks/python/apache_beam/yaml/yaml_transform_unit_test.py index a47de306b626..d68c029be559 100644 --- a/sdks/python/apache_beam/yaml/yaml_transform_unit_test.py +++ b/sdks/python/apache_beam/yaml/yaml_transform_unit_test.py @@ -20,7 +20,6 @@ import yaml import apache_beam as beam -from apache_beam import PCollection from apache_beam.yaml import YamlTransform from apache_beam.yaml import yaml_provider from apache_beam.yaml.yaml_provider import InlineProvider @@ -30,7 +29,6 @@ from apache_beam.yaml.yaml_transform import ensure_errors_consumed from apache_beam.yaml.yaml_transform import ensure_transforms_have_types from apache_beam.yaml.yaml_transform import expand_composite_transform -from apache_beam.yaml.yaml_transform import expand_pipeline from apache_beam.yaml.yaml_transform import extract_name from apache_beam.yaml.yaml_transform import identify_object from apache_beam.yaml.yaml_transform import normalize_inputs_outputs @@ -969,7 +967,8 @@ def test_init_with_string(self): result = YamlTransform(spec, providers_dict) self.assertIn('p1', result._providers) # check for custom providers self.assertIn('p2', result._providers) # check for custom providers - self.assertIn('LogForTesting', result._providers) # check for standard provider + self.assertIn( + 'LogForTesting', result._providers) # check for standard provider self.assertEqual(result._spec['type'], "composite") # preprocessed spec def test_init_with_dict(self): @@ -983,7 +982,8 @@ def test_init_with_dict(self): ''' spec = yaml.load(spec, Loader=SafeLineLoader) result = YamlTransform(spec) - self.assertIn('LogForTesting', result._providers) # check for standard provider + self.assertIn( + 'LogForTesting', result._providers) # check for standard provider self.assertEqual(result._spec['type'], "composite") # preprocessed spec