def test_partition_followed_by_flatten_and_groupbykey(self):
    pipeline = Pipeline('DirectPipelineRunner')
    contents = [('aa', 1), ('bb', 2), ('aa', 2)]
    created = pipeline | df.Create('A', contents)
    partitioned = created | df.Partition('B', lambda x, n: len(x) % n, 3)
    flattened = partitioned | df.Flatten('C')
    grouped = flattened | df.GroupByKey('D')
    assert_that(grouped, equal_to([('aa', [1, 2]), ('bb', [2])]))
    pipeline.run()
Regression test for an issue with how partitions are handled.
dataset/ETHPy150Open GoogleCloudPlatform/DataflowPythonSDK/google/cloud/dataflow/transforms/ptransform_test.py/PTransformTest.test_partition_followed_by_flatten_and_groupbykey