Details
-
Bug
-
Status: Resolved
-
P2
-
Resolution: Duplicate
-
None
-
None
Description
In this example, the input type hint does not currently get propagated (TypeCheckError is not raise):
def test_typed_ptransform_fn(self): # Test that type hints are propagated to the created PTransform. @beam.ptransform_fn @typehints.with_input_types(int) def MyMap(pcoll): return pcoll | beam.ParDo(lambda x: [x]) self.assertListEqual([1, 2, 3], [1, 2, 3] | MyMap()) with self.assertRaises(typehints.TypeCheckError): _ = ['a'] | MyMap()
The fix is relatively simple but might break existing pipelines that have old (unchecked) hints.
Attachments
Issue Links
- duplicates
-
BEAM-4091 Typehint annotations don't work with @ptransform_fn annotation
- Triage Needed
- links to