limited-raincoat-94253
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
@hallowed-mouse-14616 @freezing-airport-6809 @glamorous-carpet-83516limited-raincoat-94253
05/08/2023, 8:41 PMglamorous-carpet-83516
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 literallimited-raincoat-94253
05/08/2023, 9:03 PMxxx_unrecognized: []limited-raincoat-94253
05/08/2023, 9:04 PMpolite-ability-4005
05/08/2023, 9:09 PMpolite-ability-4005
05/08/2023, 9:09 PMglamorous-carpet-83516
05/08/2023, 9:19 PMlimited-raincoat-94253
05/08/2023, 9:47 PMlimited-raincoat-94253
05/08/2023, 9:47 PMlimited-raincoat-94253
05/08/2023, 10:00 PM