mirror of
https://github.com/clearml/clearml
synced 2025-01-31 00:56:57 +00:00
Fix Task.query_tasks() fails with a None task_filter
This commit is contained in:
parent
961a41231e
commit
201d96ac13
@ -1044,19 +1044,18 @@ class Task(_Task):
|
||||
|
||||
:return: The Tasks specified by the parameter combinations (see the parameters).
|
||||
"""
|
||||
if tags:
|
||||
task_filter = task_filter or {}
|
||||
if tags:
|
||||
task_filter['tags'] = (task_filter.get('tags') or []) + list(tags)
|
||||
return_fields = {}
|
||||
if additional_return_fields:
|
||||
task_filter = task_filter or {}
|
||||
return_fields = set(list(additional_return_fields) + ['id'])
|
||||
task_filter['only_fields'] = (task_filter.get('only_fields') or []) + list(return_fields)
|
||||
|
||||
if task_filter.get('type'):
|
||||
task_filter['type'] = [str(task_type) for task_type in task_filter['type']]
|
||||
|
||||
results = cls._query_tasks(project_name=project_name, task_name=task_name, **(task_filter or {}))
|
||||
results = cls._query_tasks(project_name=project_name, task_name=task_name, **task_filter)
|
||||
return [t.id for t in results] if not additional_return_fields else \
|
||||
[{k: cls._get_data_property(prop_path=k, data=r, raise_on_error=False, log_on_error=False)
|
||||
for k in return_fields}
|
||||
|
Loading…
Reference in New Issue
Block a user