Skip to content

Commit 1c64e15

Browse files
committed
Add custom_path property & update path property in kfp sdk Artifact class.
Signed-off-by: agoins <[email protected]>
1 parent c154e47 commit 1c64e15

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def __init__(self,
8282
self.uri = uri or ''
8383
self.name = name or ''
8484
self.metadata = metadata or {}
85+
self.custom_path: str = ''
8586

8687
@property
8788
def path(self) -> str:
@@ -92,6 +93,8 @@ def path(self, path: str) -> None:
9293
self._set_path(path)
9394

9495
def _get_path(self) -> Optional[str]:
96+
if self.custom_path != "":
97+
return self.custom_path
9598
if self.uri.startswith(RemotePrefix.GCS.value):
9699
return _GCS_LOCAL_MOUNT_PREFIX + self.uri[len(RemotePrefix.GCS.value
97100
):]
@@ -111,6 +114,16 @@ def _get_path(self) -> Optional[str]:
111114
def _set_path(self, path: str) -> None:
112115
self.uri = convert_local_path_to_remote_path(path)
113116

117+
@property
118+
def custom_path(self) -> str:
119+
return self.custom_path
120+
121+
@custom_path.setter
122+
def custom_path(self, value):
123+
self._set_custom_path = value
124+
125+
def _set_custom_path(self, path: str) -> None:
126+
self.custom_path = path
114127

115128
def convert_local_path_to_remote_path(path: str) -> str:
116129
if path.startswith(_GCS_LOCAL_MOUNT_PREFIX):

0 commit comments

Comments
 (0)