Yubo Wang
05/08/2023, 8:34 PM@task
def task(a: Union[Integer, Float]):
and then I am current generating default value as Union scalar literal:
x:
value:
value:
scalar:
value:
primitive:
value:
integer: 0
xxx_nounkeyedliteral: {}
xxx_unrecognized: []
xxx_sizecache: 0
xxx_nounkeyedliteral: {}
xxx_unrecognized: []
xxx_sizecache: 0
hash: ""
xxx_nounkeyedliteral: {}
xxx_unrecognized: []
xxx_sizecache: 0
type:
type:
simple: 1
metadata: null
annotation: null
structure:
tag: int
xxx_nounkeyedliteral: {}
xxx_unrecognized: []
xxx_sizecache: 0
xxx_nounkeyedliteral: {}
xxx_unrecognized: []
xxx_sizecache: 0
xxx_nounkeyedliteral: {}
xxx_unrecognized: []
xxx_sizecache: 0
or I can generate default as simple integer literal like this:
"x": 0
@Dan Rammer (hamersaw) @Ketan (kumare3) @Kevin SuKevin Su
05/08/2023, 9:00 PMCurrently I am generating it as a Union Scalar with the first type availableyes, I think it’s fine because
MakeDefaultLiteralForType
is only used in the tests.
```@task
def task(a: Union[Integer, Float]):```flytekit always expects
a
is a Union scalar literalYubo Wang
05/08/2023, 9:03 PMxxx_unrecognized: []
Byron Hsu
05/08/2023, 9:09 PMKevin Su
05/08/2023, 9:19 PMYubo Wang
05/08/2023, 9:47 PM