Skip to content

Commit

Permalink
fix: Fix default
Browse files Browse the repository at this point in the history
  • Loading branch information
ggydush committed Mar 27, 2024
1 parent 67377d0 commit f5e7ca2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flytekit/core/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from flytekit.core.docstring import Docstring
from flytekit.core.sentinel import DYNAMIC_INPUT_BINDING
from flytekit.core.type_engine import TypeEngine
from flytekit.core.type_helpers import UnionTypePep604
from flytekit.exceptions.user import FlyteValidationException
from flytekit.loggers import logger
from flytekit.models import interface as _interface_models
Expand Down Expand Up @@ -218,7 +219,7 @@ def transform_inputs_to_parameters(
inputs_with_def = interface.inputs_with_defaults
for k, v in inputs_vars.items():
val, _default = inputs_with_def[k]
if _default is None and get_origin(val) is typing.Union and type(None) in get_args(val):
if _default is None and get_origin(val) in [typing.Union, UnionTypePep604] and type(None) in get_args(val):
literal = Literal(scalar=Scalar(none_type=Void()))
params[k] = _interface_models.Parameter(var=v, default=literal, required=False)
else:
Expand Down

0 comments on commit f5e7ca2

Please sign in to comment.