<#5887 [Core feature] Introduce a `zero_value` fie...
# flyte-github
c
#5887 [Core feature] Introduce a
zero_value
field in
LiteralType
to capture DataClasses default fields
Issue created by EngHabu ### Motivation: Why do you think this is important?
Copy code
@dataclass
class MyOtherStruct:
    i: int = 5


@workflow
def my_wf_with_defaults(a: MyOtherStruct) -> int:
    return my_task()
`a`'s
LiteralType
would look something like this:
Copy code
metadata -> json schema in proto struct format + default value i=5
structure -> json schema (no i=5)
type: scalar ... STRUCT
This makes it difficult for clients (e.g. FlyteConsole) to display the zero value for
a
. ### Goal: What should the final outcome look like, ideally?
Copy code
message LiteralType {
  ...
  Literal zero_value = ;
}
Flytekit should populate this value for DataClasses. I think for other types the zero value is just empty/null This is not to be confused with "default value"... ### Describe alternatives you've considered Parse
metadata
and extract field information from there... ### 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/flyte