diff --git a/flytekit/clis/sdk_in_container/run.py b/flytekit/clis/sdk_in_container/run.py index 0190a92463..b5278be053 100644 --- a/flytekit/clis/sdk_in_container/run.py +++ b/flytekit/clis/sdk_in_container/run.py @@ -531,7 +531,8 @@ def _run(*args, **kwargs): raise click.UsageError( f"Default for '{input_name}' is a query, which must be specified when running locally." ) - inputs[input_name] = processed_click_value + if processed_click_value is not None: + inputs[input_name] = processed_click_value if not run_level_params.is_remote: with FlyteContextManager.with_context(_update_flyte_context(run_level_params)): diff --git a/flytekit/interaction/click_types.py b/flytekit/interaction/click_types.py index 94e9f1a88a..85ce1c7d93 100644 --- a/flytekit/interaction/click_types.py +++ b/flytekit/interaction/click_types.py @@ -383,6 +383,9 @@ def convert( if self._python_type is datetime.date: # Click produces datetime, so converting to date to avoid type mismatch error value = value.date() + # If the input matches the default value in the launch plan, serialization can be skipped. + if param and value == param.default: + return None lit = TypeEngine.to_literal(self._flyte_ctx, value, self._python_type, self._literal_type) if not self._is_remote: