https://flyte.org logo
#ask-the-community
Title
# ask-the-community
e

Eli Bixby

02/06/2023, 12:48 PM
Anyone seen this error when trying to launch a workflow from the UI, it appeared after clicking "Launch Workflow" after redefining the workflow's input arguments to include a FlyteFile:
n

Niels Bantilan

02/06/2023, 2:43 PM
hi Eli, can you share what the input type signature of that workflow is?
e

Eli Bixby

02/06/2023, 2:50 PM
I figured it out. Sorry. Was due to an optional field in a dataclass having a default argument of
None
changing:
Copy code
foo: Optional[dict[str, Any] = None
to
Copy code
foo: dict[str, Any] = field(default_factory=dict)
fixed the problem
n

Niels Bantilan

02/06/2023, 2:59 PM
Nice! Does flytekit spit out a warning at local runtime/compile time for this? I feel like
dataclasses_json
might complain about this but it might be useful to bubble this up as a flytekit warning.
e

Eli Bixby

02/06/2023, 3:00 PM
Nope. No complaint. I fixed lots of related warnings, in a library dataclass i'm wrapping, then it turned out to be an error in the dataclass I defined myself.
Weirdly
dataclasses_json
has a problem with
Union
fields but not
Optional
fields even though the latter is sugar for the former, but then it requires a multi-typed json schema field anyway so IDK?
I think it may be just a UI bug though, because I only get the form when I click on the button to render the form to fill values for a launch
27 Views