udim commented on a change in pull request #13493:
URL: https://github.com/apache/beam/pull/13493#discussion_r538958762
##########
File path: sdks/python/apache_beam/transforms/util.py
##########
@@ -785,7 +788,6 @@ def expand(self, pcoll):
@experimental()
@typehints.with_input_types(Tuple[K, V])
- @typehints.with_output_types(Tuple[K, Iterable[V]])
Review comment:
I don't believe you need infer_output_type if you have the
with_output_types decorator.
Also, I tested this a bit myself and it ended up looking like this:
```py
@typehints.with_input_types(typehints.Tuple[K_i, V_i])
@typehints.with_output_types(typehints.Tuple[ShardedKeyType[K_i],
typehints.Iterable[V_i]])
class WithShardedKey(PTransform):
```
where:
```py
K_i = typehints.TypeVariable('K_i')
V_i = typehints.TypeVariable('V_i')
```
edit: not sure if `with_input_types` needs to change but it looks consistent
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]