Hello :wave: . I'm struggling to get imperative w...
# flyte-support
d
Hello 👋 . I'm struggling to get imperative workflows working with dataclass parameters. Hopefully this is a supported workflow. This definition will hang at the
Loading packages
stage when registering.
Copy code
@dataclass
class Test:
    name: str


@fl.task(container_image=image_spec)
def test(input: Test) -> bool:
    return input.name == "foo"


wf = fl.Workflow(name="test_workflow")
wf.add_workflow_input("test", str)
node = wf.add_entity(test, input=Test(name="foo"))
Copy code
vscode ➜ /workspaces/compile-test $ pyflyte register --project my-project --domain development imperative_error.py 
Running pyflyte register from /workspaces/compile-test with images ImageConfig(default_image=Image(name='default', fqn='<http://cr.flyte.org/flyteorg/flytekit|cr.flyte.org/flyteorg/flytekit>', tag='py3.12-1.16.1', digest=None), images=[Image(name='default', fqn='<http://cr.flyte.org/flyteorg/flytekit|cr.flyte.org/flyteorg/flytekit>', tag='py3.12-1.16.1', digest=None)]) and image destination folder /root on 1 package(s) ('/workspaces/compile-test/imperative_error.py',)
Registering against localhost:30080
Detected Root /workspaces/compile-test, using this to create deployable package...
Loading packages ['imperative_error'] under source root /workspaces/compile-test
Whereas this workflow is fine
Copy code
@fl.task(container_image=image_spec)
def test(input: str) -> bool:
    return input == "foo"


wf = fl.Workflow(name="test_workflow")
wf.add_workflow_input("test", str)
node = wf.add_entity(test, input="foo")
I'm just at the evaluation stage of Flyte to understand if it can be used to orchestrate some of our compiles.
Version
1.16.1
A quick bump on this 👆 Still struggling to get imperative workflows with dataclasses working.