beam
beam copied to clipboard
[Feature Request][python]: Better typing support for TimestampedValue
What would you like to happen?
Currently transforms that return a TimestampedValue need to be typed as plain "TimestampedValue" rather than generic "TimestampedValue[T]" so all underlying information about what type is being wrapped is lost.
Issue Priority
Priority: 3
Issue Component
Component: sdk-py-core
Let me re-state to make sure I understand the ask. You're saying that TimestampValue is not a generic type, but it should be?
Sorry - yes that is a good rephrasing.
Got it, I think this would be a relatively straightforward change - just refactor TimestampedValue to inherit from Generic. In order for it to have an effect on beam typehints, we'd also want to adjust DoFn.default_type_hints to extract the element type from the generic TimestampedValue (and we should do the same for WindowedValue).
.take-issue