Replying to break the silence - in Java the DoFn is done according to the
main output type, then phantom types on the output tag are used to make
sure non-main outputs are type safe (I wouldn't expect this sort of
technique in Python)

Anyone who is more expert in Beam Python typing stuff? +Jack McCluskey
<jrmcclus...@google.com> perhaps?

Kenn

On Fri, May 9, 2025 at 6: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...
>
>
>
> 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