Add a warning asking to import Task from allegroai when calling an enterprise property on a ClearML Task object

This commit is contained in:
Alex Burlacu 2023-05-15 12:11:28 +03:00
parent 3b16553ba3
commit b91f20b7a3
2 changed files with 12 additions and 1 deletions

View File

@ -4650,3 +4650,14 @@ class Task(_Task):
auto_connect_frameworks={'detect_repository': False}) \
if state['main'] else Task.get_task(task_id=state['id'])
self.__dict__ = task.__dict__
def __getattr__(self, name):
try:
self.__getattribute__(name)
except AttributeError as e:
if self.__class__ is Task:
getLogger().warning(
"'clearml.Task' object has no attribute '{}'. Did you mean to import 'Task' from 'allegroai'?".format(name)
)
raise e

View File

@ -1 +1 @@
__version__ = '1.10.3'
__version__ = '1.10.4'