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
12 changes: 6 additions & 6 deletions sdks/python/apache_beam/transforms/window_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,21 +286,21 @@ def test_timestamped_with_combiners(self):
@attr('ValidatesRunner')
def test_window_assignment_idempotency(self):
with TestPipeline() as p:
pcoll = self.timestamped_key_values(p, 'key', 0, 1, 2, 3, 4)
pcoll = self.timestamped_key_values(p, 'key', 0, 2, 4)
result = (pcoll
| 'window' >> WindowInto(FixedWindows(2))
| 'same window' >> WindowInto(FixedWindows(2))
| 'same window again' >> WindowInto(FixedWindows(2))
| GroupByKey())

assert_that(result, equal_to([('key', [0, 1]),
('key', [2, 3]),
assert_that(result, equal_to([('key', [0]),
('key', [2]),
('key', [4])]))

@attr('ValidatesRunner')
def test_window_assignment_through_multiple_gbk_idempotency(self):
with TestPipeline() as p:
pcoll = self.timestamped_key_values(p, 'key', 0, 1, 2, 3, 4)
pcoll = self.timestamped_key_values(p, 'key', 0, 2, 4)
result = (pcoll
| 'window' >> WindowInto(FixedWindows(2))
| 'gbk' >> GroupByKey()
Expand All @@ -309,8 +309,8 @@ def test_window_assignment_through_multiple_gbk_idempotency(self):
| 'same window again' >> WindowInto(FixedWindows(2))
| 'gbk again' >> GroupByKey())

assert_that(result, equal_to([('key', [[[0, 1]]]),
('key', [[[2, 3]]]),
assert_that(result, equal_to([('key', [[[0]]]),
('key', [[[2]]]),
('key', [[[4]]])]))

class RunnerApiTest(unittest.TestCase):
Expand Down