<#5737 [Core feature] Generic alias support> Issue...
# flytekit
c
#5737 [Core feature] Generic alias support Issue created by wild-endeavor Motivation: Why do you think this is important? flytekit currently does not have generic alias support. That is, while this works @task def t1(nodelist: List[int] | None = None): print(nodelist) this does not @task def t2(nodelist: list[int] | None = None): print(nodelist) If you try to run this, you get the error
isinstance() argument 2 cannot be a parameterized generic
that's mentioned in docs for standard types. Propose: Link/Inline OR Additional context The usage of isinstance is currently coming from the
assert_type
call in the type engine. Kinda worked around that in here https://github.com/flyteorg/flytekit/pull/2743/files and got the trivial case above working but additional tests and more complex cases need to be considered. Are you sure this issue hasn't been raised already? • Yes Have you read the Code of Conduct? • Yes flyteorg/flyte
a
will this work with
Optional[list[int]]
also?
f
This does work
a
f
cc @thankful-minister-83577
a
The reason I say this is because when we try to return a
list[str]
from an agent, we get
Type of Generic List type is not supported, Only generic univariate typing.List[T] type is supported.
t
let me re-open the ticket
c