Tom Touati
05/22/2024, 2:29 PMTypeError: 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)
Samhita Alla
FLYTE_SDK_LOGGING_LEVEL=10
env var set and share the full error trace and the code as well?Tom Touati
05/23/2024, 7:49 AMTypeError: 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
Samhita Alla
get_args(expected_python_type)
should return EpochData
and the TypEngine.get_transformer()
call should return a dataclass transformer.