Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
undo defaultvalue sorting
Browse files Browse the repository at this point in the history
JOCSTAA committed Dec 1, 2022
1 parent 331b261 commit 2786638
Showing 2 changed files with 4 additions and 19 deletions.
12 changes: 4 additions & 8 deletions sdk/python/kfp/compiler/compiler_test.py
Original file line number Diff line number Diff line change
@@ -1675,12 +1675,8 @@ def my_pipeline(sample_input1: bool,
sample_input2: str,
sample_input3: Input[Model],
sample_input4: float = 3.14,
sample_input5: list = [1, 2, 3],
sample_input6: dict = {
'one': 1,
'two': 2,
'three': 3
},
sample_input5: list = [1],
sample_input6: dict = {'one': 1},
sample_input7: int = 5) -> Model:
"""This is a definition of this pipeline."""

@@ -1704,8 +1700,8 @@ def my_pipeline(sample_input1: bool,
# sample_input2: str
# sample_input3: system.Model
# sample_input4: float [Default: 3.14]
# sample_input5: list [Default: [1.0, 2.0, 3.0]]
# sample_input6: dict [Default: {'one': 1.0, 'three': 3.0, 'two': 2.0}]
# sample_input5: list [Default: [1.0]]
# sample_input6: dict [Default: {'one': 1.0}]
# sample_input7: int [Default: 5.0]
# Outputs:
# Output: system.Model
11 changes: 0 additions & 11 deletions sdk/python/kfp/compiler/pipeline_spec_builder.py
Original file line number Diff line number Diff line change
@@ -1670,17 +1670,6 @@ def collect_pipeline_signatures(root_dict: dict,
if 'defaultValue' in signature['parameters'][parameter]:
data['defaultValue'] = signature['parameters'][parameter][
'defaultValue']
if isinstance(data['defaultValue'], list) and not (
isinstance(data['defaultValue'][0], dict) or
(isinstance(data['defaultValue'][0], list))):
data['defaultValue'] = sorted(data['defaultValue'])
if isinstance(data['defaultValue'], dict) and not (
isinstance(
list(data['defaultValue'].keys())[0], dict) or
isinstance(
list(data['defaultValue'].keys())[0], list)):
data['defaultValue'] = dict(
sorted(data['defaultValue'].items()))
if isinstance(data['defaultValue'], str):
data['defaultValue'] = "'" + data['defaultValue'] + "'"
array_of_signatures.append(data)

0 comments on commit 2786638

Please sign in to comment.