Launch Plans launched in the UI seem to silently i...
# ask-the-community
Launch Plans launched in the UI seem to silently ignore "default_inputs" that are structs when specified in Python. So e.g.
Copy code
class MyStruct
   foo: str
   bar: str = 'baz'

def workflow(s: MyStruct):

qux = LaunchPlan(workflow, default_inputs=dict(s=MyStruct(foo='baz', bar='qux')))
If i go to launch
with the
launch plan it instead takes the default values from the struct definition. So
will be unset and
will be set by default as
Not sure where the error is here, though. Has anyone else seen this?
This might be because of the jsonschema that has field defaults. I think this is a bug in the Ui. The backend will do the right thing. Cc @Jason Porter / @Niels Bantilan
Indeed if I go to LaunchPlan details page the struct is visible under "default inputs", but the value is listed as a "scalar", with no additional details
Aaha, if you try Flyte remote or cli it should work
Ui bug in overriding the jsonschema with default inputs. Not sure how this can be done
But will follow up with a few Ui folks
yeah there are a couple of issues with dataclasses in the UI: @Eli Bixby would you mind opening up a [flyte-bug] issue? 👇
I appears that Enums inside of dataclasses are also broken when specified through the UI? It's trying to convert the name of the enum rather than the value of the enum back, and getting a disallowed value error.
Not sure if that's a UI bug or a general bug.
So the Ui works by extracting the json schema from the dataclass
You can refer to dataclasses_json docs
Can you explain more about the bug
So if I specify a dataclass as:
Copy code
class MyEnum(enum.Enum):
   ONE = 'one'
   TWO = 'two'

class MyStruct:
    option: MyEnum
It will nicely generate a dropdown bar in the UI when I go to launch. But then if I actually run the workflow that recieves MyStruct I'll get:
Copy code
ONE is not a valid MyEnum, please select one of ['one', 'two']
So it looks like it's sending
rather than
forward to the task. This may be a dataclasses_json bug though? I haven't tried this not in the UI, though it works just fine locally.
Ok. Confirmed this is a UI bug. Enums specified via launch plans, and as default arguments are properly serialized/deserialized by value, whereas those specified in dropdown bars are serialized by name (and fail on deserialization)