acoustic-carpenter-78188
01/03/2024, 3:47 PMflytekit_client.execute
on a workflow that takes a dataclass, passing a plain dictionary with the same shape as the dataclass should execute successfully. For example:
# In my workflow:
@dataclass_json
@dataclass
class Data:
a: int
b: str
@workflow
def my_wf(x: list[Data]) -> int:
...
I should be able to call:
execution = flytekit_remote.execute(
my_workflow,
[{ "a": 10, "b": "hello" }]
)
Describe alternatives you've considered
If a flyte workflow takes a dataclass as an input, the flyte type that comes back in the workflow interface is a dataclass, so the execution expects a dataclass as input. Otherwise the type engine attempts to read the input as a dataclass and fails.
Other possible solutions to this are:
1. Determine type hints from input shape (losing some type checking)
2. Determine type hints from workflow input somehow, using the flyte types.
3. Have workflows accept primitive dicts instead of dataclasses (also losing valuable typechecking and reusability)
Propose: Link/Inline OR Additional context
No response
Are you sure this issue hasn't been raised already?
☑︎ Yes
Have you read the Code of Conduct?
☑︎ Yes
flyteorg/flyteacoustic-carpenter-78188
01/03/2024, 3:47 PM