Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
robertwb committed Jan 16, 2025
1 parent d491769 commit d03956c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
8 changes: 4 additions & 4 deletions sdks/python/apache_beam/pipeline_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1036,9 +1036,9 @@ def test_pipeline_context_annotations(self):
with p.transform_annotations(foo='first'):
pcoll = p | beam.Create([1, 2, 3]) | 'First' >> beam.Map(lambda x: x + 1)
with p.transform_annotations(foo='second'):
pcoll | 'Second' >> beam.Map(lambda x: x * 2)
_ = pcoll | 'Second' >> beam.Map(lambda x: x * 2)
with p.transform_annotations(foo='nested', another='more'):
pcoll | 'Nested' >> beam.Map(lambda x: x * 3)
_ = pcoll | 'Nested' >> beam.Map(lambda x: x * 3)

proto = p.to_runner_api()
self.assertHasAnnotation(proto, 'First', 'foo', b'first')
Expand All @@ -1051,9 +1051,9 @@ def test_beam_context_annotations(self):
with beam.transform_annotations(foo='first'):
pcoll = p | beam.Create([1, 2, 3]) | 'First' >> beam.Map(lambda x: x + 1)
with beam.transform_annotations(foo='second'):
pcoll | 'Second' >> beam.Map(lambda x: x * 2)
_ = pcoll | 'Second' >> beam.Map(lambda x: x * 2)
with beam.transform_annotations(foo='nested', another='more'):
pcoll | 'Nested' >> beam.Map(lambda x: x * 3)
_ = pcoll | 'Nested' >> beam.Map(lambda x: x * 3)

proto = p.to_runner_api()
self.assertHasAnnotation(proto, 'First', 'foo', b'first')
Expand Down
10 changes: 4 additions & 6 deletions sdks/python/apache_beam/runners/dataflow/dataflow_runner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,19 +291,17 @@ def test_group_by_key_input_visitor_with_invalid_inputs(self):
for pcoll in [pcoll1, pcoll2]:
with self.assertRaisesRegex(ValueError, err_msg):
common.group_by_key_input_visitor().visit_transform(
AppliedPTransform(None, beam.GroupByKey(), "label", {'in': pcoll}),
None,
None)
AppliedPTransform(
None, beam.GroupByKey(), "label", {'in': pcoll}, None, None))

def test_group_by_key_input_visitor_for_non_gbk_transforms(self):
p = TestPipeline()
pcoll = PCollection(p)
for transform in [beam.Flatten(), beam.Map(lambda x: x)]:
pcoll.element_type = typehints.Any
common.group_by_key_input_visitor().visit_transform(
AppliedPTransform(None, transform, "label", {'in': pcoll}),
None,
None)
AppliedPTransform(
None, transform, "label", {'in': pcoll}, None, None))
self.assertEqual(pcoll.element_type, typehints.Any)

def test_flatten_input_with_visitor_with_single_input(self):
Expand Down

0 comments on commit d03956c

Please sign in to comment.