Skip to content

Commit e91af08

Browse files
committed
Correct Runtime Artifact custom path logic/testing.
Signed-off-by: agoins <[email protected]>
1 parent ea5a1d8 commit e91af08

File tree

5 files changed

+547
-17
lines changed

5 files changed

+547
-17
lines changed

backend/src/v2/component/launcher_v2.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,10 @@ func mergeRuntimeArtifacts(src, dst *pipelinespec.RuntimeArtifact) {
945945
}
946946
}
947947
}
948+
949+
if src.CustomPath != nil && *src.CustomPath != "" {
950+
dst.CustomPath = src.CustomPath
951+
}
948952
}
949953

950954
func getExecutorOutputFile(path string) (*pipelinespec.ExecutorOutput, error) {

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def path(self) -> str:
9191

9292
@path.setter
9393
def path(self, path: str) -> None:
94-
self._set_custom_path(path)
94+
self._set_path(path)
9595

9696
def _get_path(self) -> Optional[str]:
9797
if self.custom_path:
@@ -114,7 +114,7 @@ def _get_path(self) -> Optional[str]:
114114

115115
@property
116116
def custom_path(self) -> str:
117-
return self._custom_path
117+
return self._get_custom_path()
118118

119119
def _get_custom_path(self) -> str:
120120
return self._custom_path
@@ -129,6 +129,10 @@ def _set_custom_path(self, value: str) -> None:
129129
def custom_path(self, value: str):
130130
self._custom_path = value
131131

132+
def set_path(self, path: str) -> None:
133+
# If user specified a custom path, use it instead of the default path.
134+
self._custom_path = path
135+
132136

133137
def convert_local_path_to_remote_path(path: str) -> str:
134138
if path.startswith(_GCS_LOCAL_MOUNT_PREFIX):

0 commit comments

Comments
 (0)