Fhuad Balogun
03/16/2023, 3:04 PMMessage:
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.
Kevin Su
03/16/2023, 3:25 PMFhuad Balogun
03/16/2023, 3:47 PM@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
Evan Sadler
03/16/2023, 4:11 PMlandscape_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.