You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@beam.apache.org by Joey Tran <jo...@schrodinger.com> on 2025/01/24 22:16:39 UTC
[python] Does python SDK support typechecking of NewTypes?
Hey all,
Does the python sdk support type checking with python NewTypes? e.g. if you
specify `UserId = NewType("UserId", str)`, and a transform expects UserIDs,
will it fail if gets a pcollection of strs?
My tests say no, but I just wanted to double check. If not, are there plans
to?
Re: [python] Does python SDK support typechecking of NewTypes?
Posted by Joey Tran <jo...@schrodinger.com>.
Nevermind, I see now it is not implemented and it is tracked by this issue:
https://github.com/apache/beam/issues/20076
On Fri, Jan 24, 2025 at 5:16 PM Joey Tran <jo...@schrodinger.com> wrote:
> Hey all,
>
> Does the python sdk support type checking with python NewTypes? e.g. if
> you specify `UserId = NewType("UserId", str)`, and a transform expects
> UserIDs, will it fail if gets a pcollection of strs?
>
> My tests say no, but I just wanted to double check. If not, are there
> plans to?
>