On Fri, May 9, 2025 at 3:14 PM Joey Tran <joey.t...@schrodinger.com> wrote:

> Seems like a hard problem. I suppose it could look something like:
> ```
> def process(self, x) -> Iterable[str | TaggedOutputs[{"numbers": int]]
> ```
> A little ugly...
>

Yeah, something like this was what I was thinking. Something that both the
Beam type checker can understand, and also standard Python typechecking
tools like mypy can use to verify (locally at least) the function body.
Maybe we'd have to borrow the Literal type from
https://peps.python.org/pep-0586/.

A minor point: we also need to understand the unwrapping of returned
TimestampeValues and WindowedValues.


> On Fri, May 9, 2025 at 6:00 PM Robert Bradshaw <rober...@waymo.com> wrote:
>
>> Unfortunately type hints have not yet been implemented for
>> multiple-ouput Fns (though I think perhaps Jack was looking into this?)
>>
>> On Fri, May 9, 2025 at 2:40 PM Joey Tran <joey.t...@schrodinger.com>
>> wrote:
>>
>>> Is it to just type it based on the main output?
>>> def process(self, x) -> str:
>>>     yield "x"
>>>     yield TaggedOutput("numbers", 5)
>>>
>>>

Reply via email to