Skip to content

Commit

Permalink
add test replicating apache#29365 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cisaacstern committed Dec 21, 2023
1 parent a106dec commit 9067a54
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sdks/python/apache_beam/runners/dask/dask_runner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ def test_create(self):
pcoll = p | beam.Create([1])
assert_that(pcoll, equal_to([1]))

def test_create_multiple(self):
with self.pipeline as p:
pcoll = p | beam.Create([1, 2, 3, 4])
assert_that(pcoll, equal_to([1, 2, 3, 4]))

def test_create_and_map(self):
def double(x):
return x * 2
Expand All @@ -89,6 +94,14 @@ def double(x):
pcoll = p | beam.Create([1]) | beam.Map(double) | beam.GroupByKey()
assert_that(pcoll, equal_to([(2, [1])]))

def test_groupby_string_keys(self):
with self.pipeline as p:
pcoll = (
p
| beam.Create([('a', 1), ('a', 2), ('b', 3), ('b', 4)])
| beam.GroupByKey())
assert_that(pcoll, equal_to([('a', [1, 2]), ('b', [3, 4])]))


if __name__ == '__main__':
unittest.main()

0 comments on commit 9067a54

Please sign in to comment.