I think it because of these None values: ``` 'time...
# ask-the-community
f
I think it because of these None values:
Copy code
'timesteps_total': None,
 'episodes_total': None,
j
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
k
yes, could you try Dict[str, Optional[Any]]
f
@Kevin Su, 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")
y
this is also a bit like a grab bag of entries. would it be possible for you to convert it into a dataclass?
g
an untyped
dict
should do the trick here too
f
@Greg Gydush, how do you define a untyped dict in a return type? Like this?
Copy code
-> typing.Dict
g
yes
f
@Greg Gydush, it works! Thank you very much!
@Yee, it could work. However, I don’t want the added efforts of defining the dataclass and the maintenance afterwards.
y
yup got it.
thanks @Greg Gydush!
g
of course, the DictTransformer is very versatile - I ran into the same issue before, but found this fix!
121 Views