<#1059 fix default values handling in the CLI for ...
# flyte-github
a
#1059 fix default values handling in the CLI for pydantic and dataclasses Pull request opened by cosmicBboy This pull request addresses a regression in the handling of default input values for deployed tasks in the Flyte CLI, specifically ensuring that the
_has_default
sentinel marker is never propagated as an actual input value or rendered in CLI help output. The changes ensure that the real default values are correctly resolved and displayed, and that the sentinel is safely handled in both the CLI and runtime paths. Extensive regression tests are also added to prevent future occurrences of this issue. Fixes and improvements to default value handling: • The CLI now properly resolves default values for deployed tasks, ensuring that the
_has_default
sentinel is replaced with the actual default value from
NativeInterface._remote_defaults
before passing to click options or runtime serialization. [1] [2] [3] [4] [5] [6] • Defense-in-depth: The runtime path drops any
_has_default
sentinel values from kwargs, ensuring only valid defaults are serialized and sent to remote pods. [1] [2] Testing and regression coverage: • New tests are added to reproduce the original regression and to pin correct behavior for both CLI rendering and runtime materialization of default values, including cases where the sentinel class or instance might leak through. Documentation and examples: • An example script (
examples/cli/default_values_cli.py
) is added, demonstrating the three supported patterns for task input defaults (Pydantic model, frozen dataclass, and primitive function defaults), and instructions for running and testing these via the CLI. These changes ensure that Flyte CLI users see correct default values in help output and that deployed tasks receive proper input values, eliminating confusing errors caused by the sentinel marker. flyteorg/flyte-sdk