Skip to content

Commit

Permalink
Changes CoGroupByKey typehint from List to Iterable (#22984)
Browse files Browse the repository at this point in the history
Co-authored-by: Lukasz Cwik <[email protected]>
  • Loading branch information
ryanthompson591 and lukecwik authored Sep 27, 2022
1 parent 3c2459c commit 4499242
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

## Breaking Changes

* X behavior was changed ([#X](https://github.com/apache/beam/issues/X)).
* 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

Expand Down
3 changes: 1 addition & 2 deletions sdks/python/apache_beam/transforms/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]]
Expand Down

0 comments on commit 4499242

Please sign in to comment.