From a09cdfcc2435864b586716f62992f197e2e2597b Mon Sep 17 00:00:00 2001 From: Ryan Thompson Date: Wed, 31 Aug 2022 15:13:22 -0400 Subject: [PATCH 1/6] Changes CoGroupByKey typehint from List to Iterable --- sdks/python/apache_beam/transforms/util.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdks/python/apache_beam/transforms/util.py b/sdks/python/apache_beam/transforms/util.py index 13d68df3715f..cb4b86245e00 100644 --- a/sdks/python/apache_beam/transforms/util.py +++ b/sdks/python/apache_beam/transforms/util.py @@ -198,8 +198,7 @@ def expand(self, pcolls): input_value_types.append(value_type) output_key_type = typehints.Union[tuple(input_key_types)] iterable_input_value_types = tuple( - # TODO: Change List[t] to Iterable[t] - typehints.List[t] for t in input_value_types) + typehints.Iterable[t] for t in input_value_types) output_value_type = typehints.Dict[ str, typehints.Union[iterable_input_value_types or [typehints.Any]]] From 380fb2f60831837bfebe9aaf43042b757e0d2fbb Mon Sep 17 00:00:00 2001 From: Ryan Thompson Date: Tue, 13 Sep 2022 11:03:35 -0400 Subject: [PATCH 2/6] updated changes.md documentation --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index f23254f2bf77..f949cd36f7ef 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -66,7 +66,7 @@ ## Breaking Changes -* X behavior was changed ([#X](https://github.com/apache/beam/issues/X)). +* Python SDK CoGroupByKey now outputs an iterable instead of a list. [#21556](https://github.com/apache/beam/issues/21556) ## Deprecations From 930560c60c509e3388e0a04e9e8b95f2f378fb26 Mon Sep 17 00:00:00 2001 From: Ryan Thompson Date: Tue, 13 Sep 2022 11:34:36 -0400 Subject: [PATCH 3/6] added document to change --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index f949cd36f7ef..818944ae6bcb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -66,7 +66,7 @@ ## Breaking Changes -* Python SDK CoGroupByKey now outputs an iterable instead of a list. [#21556](https://github.com/apache/beam/issues/21556) +* Python SDK CoGroupByKey now outputs an iterable instead of a list. [#21556](https://github.com/apache/beam/issues/21556) See [document](https://docs.google.com/document/d/1RIzm8-g-0CyVsPb6yasjwokJQFoKHG4NjRUcKHKINu0) for suggested fixes for different error cases. ## Deprecations From ee6cd7c2400e765bc4e37033ab120d286fd09ac3 Mon Sep 17 00:00:00 2001 From: Ryan Thompson Date: Tue, 13 Sep 2022 12:28:08 -0400 Subject: [PATCH 4/6] Update CHANGES.md Co-authored-by: Lukasz Cwik --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 818944ae6bcb..274d7e38e80b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -66,7 +66,7 @@ ## Breaking Changes -* Python SDK CoGroupByKey now outputs an iterable instead of a list. [#21556](https://github.com/apache/beam/issues/21556) See [document](https://docs.google.com/document/d/1RIzm8-g-0CyVsPb6yasjwokJQFoKHG4NjRUcKHKINu0) for suggested fixes for different error cases. +* Python SDK CoGroupByKey outputs an iterable allowing for arbitrarily large results. [#21556](https://github.com/apache/beam/issues/21556) See [document](https://docs.google.com/document/d/1RIzm8-g-0CyVsPb6yasjwokJQFoKHG4NjRUcKHKINu0) for suggested fixes for different error cases that assumed a list type was returned. ## Deprecations From 71c5cfcc3eb38aac1d5e9b9cd95ff3ab638194c7 Mon Sep 17 00:00:00 2001 From: Ryan Thompson Date: Thu, 15 Sep 2022 16:51:00 -0400 Subject: [PATCH 5/6] Update CHANGES.md Adds information about what exactly is broken as well as how to fix. --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 274d7e38e80b..78ec884b1f77 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -66,7 +66,7 @@ ## Breaking Changes -* Python SDK CoGroupByKey outputs an iterable allowing for arbitrarily large results. [#21556](https://github.com/apache/beam/issues/21556) See [document](https://docs.google.com/document/d/1RIzm8-g-0CyVsPb6yasjwokJQFoKHG4NjRUcKHKINu0) for suggested fixes for different error cases that assumed a list type was returned. +* Python SDK CoGroupByKey outputs an iterable allowing for arbitrarily large results. [#21556](https://github.com/apache/beam/issues/21556) Beam users may see a type or other runtime error on transforms downstream from CoGroupByKey. Users must change methods expecting a List to expect an Iterable going forward. See [document](https://docs.google.com/document/d/1RIzm8-g-0CyVsPb6yasjwokJQFoKHG4NjRUcKHKINu0) for information and fixes. ## Deprecations From 4420e5866ffb9d3e366507e468d5f3bd6b0ca861 Mon Sep 17 00:00:00 2001 From: Ryan Thompson Date: Mon, 19 Sep 2022 17:12:08 -0400 Subject: [PATCH 6/6] Update CHANGES.md Simplified changes.md --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 78ec884b1f77..7f03f15a5e81 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -66,7 +66,7 @@ ## Breaking Changes -* Python SDK CoGroupByKey outputs an iterable allowing for arbitrarily large results. [#21556](https://github.com/apache/beam/issues/21556) Beam users may see a type or other runtime error on transforms downstream from CoGroupByKey. Users must change methods expecting a List to expect an Iterable going forward. See [document](https://docs.google.com/document/d/1RIzm8-g-0CyVsPb6yasjwokJQFoKHG4NjRUcKHKINu0) for information and fixes. +* Python SDK CoGroupByKey outputs an iterable allowing for arbitrarily large results. [#21556](https://github.com/apache/beam/issues/21556) Beam users may see an error on transforms downstream from CoGroupByKey. Users must change methods expecting a List to expect an Iterable going forward. See [document](https://docs.google.com/document/d/1RIzm8-g-0CyVsPb6yasjwokJQFoKHG4NjRUcKHKINu0) for information and fixes. ## Deprecations