Hello all I'm getting this error when trying to cr...
# ask-the-community
v
Hello all I'm getting this error when trying to create a task with custom object:
Copy code
ValueError: Only generic univariate typing.List[T] type is supported.
I tried to use the example in doc, https://flyte--943.org.readthedocs.build/projects/cookbook/en/943/auto/core/type_system/custom_objects.html
In this case, I adapted the example to create a custom object, and I'm trying to create a map task that receives a list of this objects
e
Can you share the code, @Victor Gustavo da Silva Oliveira?
v
The custom class
Copy code
@dataclass_json
@dataclass
class Test_custom_object(object):
    flyte_file: FlyteFile
    test_data: str
A snippet from the class
Copy code
@task(requests=Resources(cpu='1', mem='600Mi'))
def test_task(file: Datum) -> float:
    print(file.flyte_file)
Snippet from workflow
Copy code
all_samples = map_task(
       sample_task,
       metadata=TaskMetadata(retries=1)
    )(file=samples)

map_task(
        test_task,
        metadata=TaskMetadata(retries=1)
    )(file=all_samples)
s
@Victor Gustavo da Silva Oliveira, which task is throwing the error? And what's the type of
all_samples
list elements?
v
The error is coming from the latter map task, and
all_samples
is returning me a list of
Test_custom_object
114 Views