Skip to content

Commit e24f5b1

Browse files
committed
Fix sdk-tests by updating with custom_path field.
Signed-off-by: agoins <[email protected]>
1 parent 545a55f commit e24f5b1

File tree

4 files changed

+23
-27
lines changed

4 files changed

+23
-27
lines changed

api/v2alpha1/go/pipelinespec/pipeline_spec.pb.go

Lines changed: 4 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/python/kfp/dsl/executor_test.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ def test_output_metadata(self):
288288
"type": {
289289
"schemaTitle": "system.Metrics"
290290
},
291-
"uri": "gs://some-bucket/output_artifact_two"
291+
"uri": "gs://some-bucket/output_artifact_two",
292+
"custom_path": ""
292293
}
293294
]
294295
}
@@ -594,6 +595,7 @@ def test_func(first: int, second: int) -> Dict[str, int]:
594595
},
595596
})
596597

598+
#TODO: Question - why does this function name end in "1"?
597599
def test_artifact_output1(self):
598600
executor_input = """\
599601
{
@@ -613,7 +615,8 @@ def test_artifact_output1(self):
613615
"type": {
614616
"schemaTitle": "system.Artifact"
615617
},
616-
"uri": "gs://some-bucket/output"
618+
"uri": "gs://some-bucket/output",
619+
"custom_path": ""
617620
}
618621
]
619622
}
@@ -677,7 +680,8 @@ def test_artifact_output2(self):
677680
"type": {
678681
"schemaTitle": "system.Artifact"
679682
},
680-
"uri": "gs://some-bucket/output"
683+
"uri": "gs://some-bucket/output",
684+
"custom_path": ""
681685
}
682686
]
683687
}
@@ -763,7 +767,8 @@ def test_named_tuple_output(self):
763767
"type": {
764768
"schemaTitle": "system.Dataset"
765769
},
766-
"uri": "gs://some-bucket/output_dataset"
770+
"uri": "gs://some-bucket/output_dataset",
771+
"custom_path": ""
767772
}
768773
]
769774
}
@@ -961,7 +966,8 @@ def test_component_with_input_path(self):
961966
"uri": "gs://mlpipeline/v2/artifacts/my-test-pipeline-beta/b2b0cdee-b15c-48ff-b8bc-a394ae46c854/preprocess/output_dataset_one",
962967
"metadata": {
963968
"display_name": "output_dataset_one"
964-
}
969+
},
970+
"custom_path": "uri"
965971
}
966972
]
967973
}
@@ -1259,7 +1265,8 @@ def test_single_artifact_output_pythonic(self):
12591265
"type": {
12601266
"schemaTitle": "system.Artifact"
12611267
},
1262-
"uri": "gs://some-bucket/output"
1268+
"uri": "gs://some-bucket/output",
1269+
"custom_path": ""
12631270
}
12641271
]
12651272
}
@@ -1290,7 +1297,8 @@ def test_func() -> Artifact:
12901297
'gs://manually_specified_bucket/foo',
12911298
'metadata': {
12921299
'data': 123
1293-
}
1300+
},
1301+
"custom_path": ""
12941302
}]
12951303
}
12961304
},
@@ -1373,7 +1381,8 @@ def test_multiple_artifact_output_pythonic_with_get_uri(self):
13731381
"type": {
13741382
"schemaTitle": "system.Dataset"
13751383
},
1376-
"uri": "gs://some-bucket/output"
1384+
"uri": "gs://some-bucket/output",
1385+
"custom_path": ""
13771386
}
13781387
]
13791388
}

sdk/python/kfp/dsl/types/artifact_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def path(self, path: str) -> None:
9393
self._set_path(path)
9494

9595
def _get_path(self) -> Optional[str]:
96-
if self.custom_path is not '':
96+
if self.custom_path != '':
9797
return self.custom_path
9898
if self.uri.startswith(RemotePrefix.GCS.value):
9999
return _GCS_LOCAL_MOUNT_PREFIX + self.uri[len(RemotePrefix.GCS.value

test/presubmit-tests-sdk.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if [ "${SETUP_ENV}" = "true" ]; then
2626
python3 -m pip install -r sdk/python/requirements-dev.txt
2727
python3 -m pip install setuptools
2828
python3 -m pip install wheel==0.42.0
29-
python3 -m pip install coveralls==4.0.1
29+
python3 -m pip install coveralls==3.3.1
3030
python3 -m pip install --upgrade protobuf
3131
python3 -m pip install sdk/python
3232

0 commit comments

Comments
 (0)