diff --git a/gokart/task.py b/gokart/task.py index a7f7a06d..1ef1e569 100644 --- a/gokart/task.py +++ b/gokart/task.py @@ -540,13 +540,15 @@ def _get_module_versions(self) -> str: def __repr__(self): """ - Build a task representation like `MyTask(param1=1.5, param2='5', data_task=DataTask(id=35tyi))` + Build a task representation like + `MyTask[aca2f28555dadd0f1e3dee3d4b973651](param1=1.5, param2='5', data_task=DataTask(c1f5d06aa580c5761c55bd83b18b0b4e))` """ return self._get_task_string() def __str__(self): """ - Build a human-readable task representation like `MyTask(param1=1.5, param2='5', data_task=DataTask(id=35tyi))` + Build a human-readable task representation like + `MyTask[aca2f28555dadd0f1e3dee3d4b973651](param1=1.5, param2='5', data_task=DataTask(c1f5d06aa580c5761c55bd83b18b0b4e))` This includes only public parameters """ return self._get_task_string(only_public=True) @@ -566,7 +568,7 @@ def _get_task_string(self, only_public=False): if param_obj.significant and ((not only_public) or param_obj.visibility == ParameterVisibility.PUBLIC): repr_parts.append(f'{param_name}={self._make_representation(param_obj, param_value)}') - task_str = f'{self.get_task_family()}({", ".join(repr_parts)})' + task_str = f'{self.get_task_family()}[{self.make_unique_id()}]({", ".join(repr_parts)})' return task_str def _make_representation(self, param_obj: luigi.Parameter, param_value):