Fix Task.get_task() does not load output_uri from stored Task

This commit is contained in:
allegroai 2021-10-29 22:56:44 +03:00
parent e53a76b713
commit 308bbe88ed
2 changed files with 7 additions and 7 deletions

View File

@ -171,7 +171,7 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
self.name = task_name
else:
# this is an existing task, let's try to verify stuff
self._validate()
self._validate(check_output_dest_credentials=False)
if self.data is None:
raise ValueError("Task ID \"{}\" could not be found".format(self.id))
@ -184,7 +184,11 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
self._artifacts_manager = Artifacts(self)
self._hyper_params_manager = HyperParams(self)
def _validate(self, check_output_dest_credentials=True):
def _validate(self, check_output_dest_credentials=False):
if not self._is_remote_main_task():
self._storage_uri = self.get_output_destination(raise_on_error=False, log_on_error=False) or None
return
raise_errors = self._raise_on_validation_errors
output_dest = self.get_output_destination(raise_on_error=False, log_on_error=False)
if output_dest and check_output_dest_credentials:

View File

@ -206,7 +206,7 @@ class Task(_Task):
auto_resource_monitoring=True, # type: bool
auto_connect_streams=True, # type: Union[bool, Mapping[str, bool]]
):
# type: (...) -> Task
# type: (...) -> "Task"
"""
Creates a new Task (experiment) if:
@ -2984,10 +2984,6 @@ class Task(_Task):
self._connect_dictionary(a_dict, name)
return an_object
def _validate(self, check_output_dest_credentials=False):
if running_remotely():
super(Task, self)._validate(check_output_dest_credentials=False)
def _dev_mode_stop_task(self, stop_reason, pid=None):
# make sure we do not get called (by a daemon thread) after at_exit
if self._at_exit_called: