Skip to content

Commit

Permalink
SDK - Compiler - Using properly serialized pipeline parameter defaults (
Browse files Browse the repository at this point in the history
#3832)

* SDK - Compiler - Using properly serialized pipeline parameter defaults

Fixes #3806

* Sort the keys so that the serialized defaults are stable in python 3.5
  • Loading branch information
Ark-kun authored Jun 9, 2020
1 parent 5f9e56a commit 40372e5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions sdk/python/kfp/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,11 +812,10 @@ def _create_workflow(self,
# Fill in the default values.
args_list_with_defaults = []
if pipeline_meta.inputs:
args_list_with_defaults = [dsl.PipelineParam(sanitize_k8s_name(arg_name, True))
for arg_name in argspec.args]
if argspec.defaults:
for arg, default in zip(reversed(args_list_with_defaults), reversed(argspec.defaults)):
arg.value = default.value if isinstance(default, dsl.PipelineParam) else default
args_list_with_defaults = [
dsl.PipelineParam(sanitize_k8s_name(input_spec.name, True), value=input_spec.default)
for input_spec in pipeline_meta.inputs
]
elif params_list:
# Or, if args are provided by params_list, fill in pipeline_meta.
for param in params_list:
Expand Down

0 comments on commit 40372e5

Please sign in to comment.