<#4581 [BUG] Accessing Dataclass fields fail on lo...
# flyte-github
a
#4581 [BUG] Accessing Dataclass fields fail on local execute Issue created by EngHabu ### Describe the bug from dataclasses import dataclass import typing from dataclasses_json import dataclass_json from flytekit import task, workflow @dataclass_json @dataclass class Foo: a: typing.List[str] @task def my_task(a: typing.List[str]) -> int: return len(a) @task def gen_foo() -> Foo: return Foo(a=["hello", "world"]) @workflow def my_wf() -> int: f = gen_foo() return my_task(a=f.a) Run:
Copy code
pyflyte run my_wf.py my_wf
Error:
Copy code
Running Execution on local.
2023-12-12 08:55:30,747011 ERROR    {"asctime": "2023-12-12 08:55:30,747", "name": "flytekit", "levelname": "ERROR", "message": "Failed to    base_task.py:263
                                    convert inputs of task 'test_bug.my_task':\n  Failed argument 'a': Failed to convert to generic protobuf                  
                                    struct"}                                                                                                                  
Failed with Unknown Exception <class 'TypeError'> Reason: Encountered error while executing workflow 'test_bug.my_wf':
  Error encountered while executing 'my_wf':
  Failed to convert inputs of task 'test_bug.my_task':
  Failed argument 'a': Failed to convert to generic protobuf struct
Encountered error while executing workflow 'test_bug.my_wf':
  Error encountered while executing 'my_wf':
  Failed to convert inputs of task 'test_bug.my_task':
  Failed argument 'a': Failed to convert to generic protobuf struct
### Expected behavior It should work... ### Additional context to reproduce No response ### Screenshots No response ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte
c