<#6057 [BUG] [flytekit] cannot pass dataclass with...
# flytekit
c
#6057 [BUG] [flytekit] cannot pass dataclass with Optional[list] to FlyteRemote.execute Issue created by gvogel-hh Describe the bug When trying to pass a dataclass containing an optional list as input to FlyteRemote.execute(), a
KeyError: 'items'
is raised at flytekit/core/type_engine.py:839 in generate_attribute_list_from_dataclass_json_mixin (flytekit==1.13.14). Expected behavior Workflow is started with the given dataclass instance. Additional context to reproduce
Copy code
from dataclasses import dataclass
from typing import Optional

from flytekit import task, workflow
from flytekit.configuration import Config
from flytekit.remote import FlyteRemote
from mashumaro.mixins.json import DataClassJSONMixin


@dataclass
class MyConfig(DataClassJSONMixin):
    op_list: Optional[list[str]]


@task
def t() -> None:
    pass


@workflow
def wf(config: MyConfig) -> None:
    t()


if __name__ == "__main__":
    config = MyConfig(op_list=["a", "b"])
    remote = FlyteRemote(
        config=Config.auto(config_file="../config.yaml"),
        default_project="flytesnacks",
        default_domain="development",
    )

    remote_wf = remote.fetch_workflow(name="<http://mywf.wf|mywf.wf>")
    execution = remote.execute(remote_wf, inputs={"config": config})
Screenshots No response Are you sure this issue hasn't been raised already? • Yes Have you read the Code of Conduct? • Yes flyteorg/flyte