Hello everyone. I am getting this error during a ...
# ask-the-community
f
Hello everyone. I am getting this error during a workflow run, seem to be after completing a task and need to pass the result to the next task in the workflow. What could be the issue, please?
Copy code
Message:

    Failed to convert return value for var o0 for function flyte.workflows.challenge_task_cpu with error <class 'AttributeError'>: __args__

SYSTEM ERROR! Contact platform administrators.
k
Mind sharing code snippet
f
Thank you @Kevin Su. Here is a snippet
Copy code
@task(requests=Resources(cpu="1", mem="500Mi"), limits=Resources(cpu="2", mem="1Gi"))
def challenge_task_cpu(constraint_dict: Dict) -> Challenge:
    """CPU Challenge task"""
    constraint_res = Challenge(constraint_dict)
    return constraint_res

@task(requests=Resources(cpu="1", mem="500Mi"), limits=Resources(cpu="2", mem="1Gi"))
def landscape_task_cpu(
    landscape_type: Landscape,
    dataset_index: str,
    constraint: Challenge
):
    """CPU Landscape task"""
    landscape_obj = landscape_type(
        dataset_index=dataset_index,
        constraint=constraint,
    )
    return landscape_obj

@dataclass_json
@dataclass
class Challenge:
    constraint: Dict

class Landscape:
    def __init__(self, dataset_index: str, constraint: constraint):
    self.dataset_index = dataset_index
    self.constraint = constraint
e
landscape_task_cpu
doesn't have a return type. You might need to set it to
Landscape
and hopefully Flyte will pickle it. These are the docs I am working from: https://docs.flyte.org/projects/cookbook/en/latest/auto/core/type_system/flyte_pickle.html.
110 Views