I think it because of these None values: ``` 'time...
# flyte-support
s
I think it because of these None values:
Copy code
'timesteps_total': None,
 'episodes_total': None,
m
ohh yeah, Flyte does not like Nones, we have been converting it to empty strings ๐Ÿ˜… maybe nested None doesnt work, but it should support Optional or None starting from 1.1 i think
g
yes, could you try Dict[str, Optional[Any]]
s
@glamorous-carpet-83516, I tried and got:
Copy code
File "/Users/fshen/hbo-code/dai-mle-models/env/lib/python3.8/site-packages/flytekit/core/type_engine.py", line 1060, in to_literal
    raise TypeError("Ambiguous choice of variant for union type")
t
this is also a bit like a grab bag of entries. would it be possible for you to convert it into a dataclass?
r
an untyped
dict
should do the trick here too
s
@rich-garden-69988, how do you define a untyped dict in a return type? Like this?
Copy code
-> typing.Dict
๐Ÿ‘ 1
r
yes
s
@rich-garden-69988, it works! Thank you very much!
๐Ÿš€ 1
@thankful-minister-83577, it could work. However, I donโ€™t want the added efforts of defining the dataclass and the maintenance afterwards.
t
yup got it.
thanks @rich-garden-69988!
r
of course, the DictTransformer is very versatile - I ran into the same issue before, but found this fix!
158 Views