You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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="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
The text was updated successfully, but these errors were encountered:
gvogel-hh
changed the title
[BUG] [flytekit] cannot pass dataclass with Optional[list] to remote.execute
[BUG] [flytekit] cannot pass dataclass with Optional[list] to FlyteRemote.execute
Nov 29, 2024
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
Screenshots
No response
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: