Hi community, we recently upgrade flytekit to 1.11...
# flyte-support
h
Hi community, we recently upgrade flytekit to 1.11.0 and we saw:
Copy code
line 997, in get_transformer
    raise ValueError(f"Generic Type {python_type.__origin__} not supported currently in Flytekit.")
ValueError: Generic Type <class 'collections.defaultdict'> not supported currently in Flytekit.
There is no issue in flytekit 1.3.2 we used before. Is this the new constraint we introduce to newer version? Is there workaround to support generic type?
Copy code
@task(
    cache=True,
    cache_serialize=True,
    cache_version="v3",
    requests=Resources(mem="200Gi"),
    retries=0,
)
def correlation_job(
    table_s3_path: str, train_start: str, train_end: str, config_file: str, k: int
) -> DefaultDict:
the code block that triggers the issue
t
can you make the return type just
dict
?
you’re not looking to have flytekit interpret the entire structure of the map right?
h
can you make the return type just
dict
?
We are recommending the user to do this.
you’re not looking to have flytekit interpret the entire structure of the map right?
I don't since this is user's code...
t
oh i mean if you have a
Dict[str, T]
(as opposed to a
dict
) flytekit will interpret it as a LiteralMap
but yeah, thank you. i think something changed in flytekit’s type engine. sorry about this
have you run into any other issues with the upgrade?
h
Oh I see. Thanks for asking! This is the only issue I identify so far.