Fix artifacts and models use task original name and not new name

This commit is contained in:
allegroai 2022-09-02 23:34:22 +03:00
parent c2b4f728f4
commit bb4b79c1e8
2 changed files with 9 additions and 4 deletions

View File

@ -1517,9 +1517,10 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
:param name: The name of the Task.
:type name: str
"""
name = name or ''
self._set_task_property("name", str(name))
self._edit(name=self.data.name)
name = str(name) or ""
self._set_task_property("name", name)
self._edit(name=name)
self.data.name = name
def set_parent(self, parent):
# type: (Optional[Union[str, Task]]) -> ()

View File

@ -311,6 +311,8 @@ class Artifacts(object):
self._task_artifact_list = []
self._task_edit_lock = ForkSafeRLock()
self._storage_prefix = None
self._task_name = None
self._project_name = None
def register_artifact(self, name, artifact, metadata=None, uniqueness_columns=True):
# type: (str, DataFrame, Optional[dict], Union[bool, Sequence[str]]) -> ()
@ -999,7 +1001,9 @@ class Artifacts(object):
def _get_storage_uri_prefix(self):
# type: () -> str
if not self._storage_prefix:
if not self._storage_prefix or self._task_name != self._task.name or self._project_name != self._task.get_project_name():
# noinspection PyProtectedMember
self._storage_prefix = self._task._get_output_destination_suffix()
self._task_name = self._task.name
self._project_name = self._task.get_project_name()
return self._storage_prefix