hmc-cs-mdrissi commented on issue #23366:
URL: https://github.com/apache/beam/issues/23366#issuecomment-1259903782
The full error message is,
```
Traceback (most recent call last):
File
"/Users/mdrissi/Snapchat/Dev/training-platform/scratch/beam_type_issue.py",
line 11, in <module>
_ = numbers | beam.GroupByKey() | beam.Map(print)
File
"/Users/mdrissi/Snapchat/Dev/.virtual_envs/bento/lib/python3.9/site-packages/apache_beam/pvalue.py",
line 137, in __or__
return self.pipeline.apply(ptransform, self)
File
"/Users/mdrissi/Snapchat/Dev/.virtual_envs/bento/lib/python3.9/site-packages/apache_beam/pipeline.py",
line 706, in apply
transform.type_check_inputs(pvalueish)
File
"/Users/mdrissi/Snapchat/Dev/.virtual_envs/bento/lib/python3.9/site-packages/apache_beam/transforms/ptransform.py",
line 457, in type_check_inputs
self.type_check_inputs_or_outputs(pvalueish, 'input')
File
"/Users/mdrissi/Snapchat/Dev/.virtual_envs/bento/lib/python3.9/site-packages/apache_beam/transforms/ptransform.py",
line 486, in type_check_inputs_or_outputs
raise TypeCheckError(
apache_beam.typehints.decorators.TypeCheckError: Input type hint violation
at GroupByKey: expected Tuple[TypeVariable[K], TypeVariable[V]], got
tuple[bool, int]
Full type hint:
IOTypeHints[inputs=((Tuple[TypeVariable[K], TypeVariable[V]],), {}),
outputs=((Tuple[TypeVariable[K], Iterable[TypeVariable[V]]],), {})]
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File
"/Users/mdrissi/Snapchat/Dev/.virtual_envs/bento/lib/python3.9/site-packages/apache_beam/transforms/core.py",
line 2637, in <module>
class GroupByKey(PTransform):
File
"/Users/mdrissi/Snapchat/Dev/.virtual_envs/bento/lib/python3.9/site-packages/apache_beam/typehints/decorators.py",
line 775, in annotate_input_types
th = getattr(f, '_type_hints', IOTypeHints.empty()).with_input_types(
based on:
IOTypeHints[inputs=None, outputs=((Tuple[TypeVariable[K],
Iterable[TypeVariable[V]]],), {})]
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in
_call_with_frames_removed
File
"/Users/mdrissi/Snapchat/Dev/.virtual_envs/bento/lib/python3.9/site-packages/apache_beam/transforms/core.py",
line 2637, in <module>
class GroupByKey(PTransform):
File
"/Users/mdrissi/Snapchat/Dev/.virtual_envs/bento/lib/python3.9/site-packages/apache_beam/typehints/decorators.py",
line 863, in annotate_output_types
f._type_hints = th.with_output_types(return_type_hint) # pylint:
disable=protected-access
```
With key line being `Input type hint violation at GroupByKey: expected
Tuple[TypeVariable[K], TypeVariable[V]], got tuple[bool, int]` caused by
`is_consistent_with(Tuple[K, V], tuple[bool, int])` returning false.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]