Hey all, is there any easy way to convert Flyte ex...
# flyte-support
l
Hey all, is there any easy way to convert Flyte execution output to json string? I have tried using
Copy code
execution = remote.fetch_execution(name="...", project="...", domain="...")
execution_output = {}
for key, val in execution.outputs.items():
        execution_output[key] = val
this works well if the output is a python dict. But it throws exception
Cannot convert from <FlyteLiteral scalar { primitive
{ string_value:… to <class Dict>
when the workflow return type is primitive type. how could I handle both scenarios? Any help is appreciated!
f
Yes look at pyflyte fetch
👍 1
I am Assuming you just want outputs
l
ah actually I got the root cause for the exception. Flyte uses the type hint to infer the output key. if there is a mismatch between the actual output type and type hint, the error will be thrown.