Hi all im trying to access outputs of a workflow t...
# ask-the-community
t
Hi all im trying to access outputs of a workflow that outputs an object of type Optional[EpochData], when EpochData is a dataclass that inherits from datajsonmixin.. The weird thing is that this object has no problem getting transferred from task to task, but when i run execution.outputs["o0"] im getting this error:
Copy code
TypeError: Cannot convert from <FlyteLiteral(Literal) scalar { generic { fields { key: "metadata" value { 
struct_value { fields { key: "sampling_frequency" value { number_value: 500 } } fields { key: "measurement_id" 
.
.
.
to typing.Optional[types.EpochData] (using tag None)
s
can you run the code with
FLYTE_SDK_LOGGING_LEVEL=10
env var set and share the full error trace and the code as well?
t
@Samhita Alla Thanks
Copy code
TypeError: Cannot convert from <FlyteLiteral(Literal) scalar { generic { fields { key: "metadata" value { 
struct_value { fields { key: "sampling_frequency" value { number_value: 500 } } fields { key: "measurement_id" 
value { string_value: "**censored***" } } fields { key: "mapping" value { struct_value { fields { key: "tpp9" value { 
struct_value { fields { key: "coords" value { list_value { values { number_value: -78.99885001 } values { 
number_value: -61.11634012 } values { number_value: -16.75391144 } } } } } } } fields { key: "af3" value { 
struct_value { fields { key: "coords" value { list_value { values { number_value: -32.02819158 } values { 
number_value: 74.87124038 } values { number_value: 31.58982549 } } } } } } } } } } fields { key: "mapping_name" 
value { string_value: "EEG 1.2" } } } } } fields { key: "epoch_name" value { null_value: NULL_VALUE } } fields { 
key: "data" value { struct_value { fields { key: "uri" value { string_value: 
"<s3://bs-flyte-prod/data/*******(censored)>" } } fields { key: 
"file_format" value { string_value: "parquet" } } } } } } }> to typing.Optional[types.EpochData] (using tag None)

Attached images - error stack trace, wf, last task signature
btw, we use a MapTask wrapper but it obviously uses flyte's map_task underneath.
** important - the output object is getting passed around by tasks without a problem - only when trying to access the outputs manually it creates an issue
s
could you add some debug prints here?
get_args(expected_python_type)
should return
EpochData
and the
TypEngine.get_transformer()
call should return a dataclass transformer.