mirror of
https://github.com/clearml/clearml
synced 2025-01-31 17:17:00 +00:00
Add tags to Dataset listing
This commit is contained in:
parent
b33ac21764
commit
532010c93d
@ -330,11 +330,12 @@ def ds_search(args):
|
||||
dataset_project=args.project or None, partial_name=args.name or None,
|
||||
tags=args.tags or None, ids=args.ids or None
|
||||
)
|
||||
formatting = '{:16} | {:32} | {:19} | {:32}'
|
||||
print(formatting.format('project', 'name', 'created', 'id'))
|
||||
print('-' * len(formatting.format('-', '-', '-', '-')))
|
||||
formatting = '{:16} | {:32} | {:19} | {:19} | {:32}'
|
||||
print(formatting.format('project', 'name', 'tags', 'created', 'id'))
|
||||
print('-' * len(formatting.format('-', '-', '-', '-', '-')))
|
||||
for d in datasets:
|
||||
print(formatting.format(d['project'], d['name'], str(d['created']).split('.')[0], d['id']))
|
||||
print(formatting.format(
|
||||
d['project'], d['name'], str(d['tags'] or [])[1:-1], str(d['created']).split('.')[0], d['id']))
|
||||
return 0
|
||||
|
||||
|
||||
|
@ -890,13 +890,17 @@ class Dataset(object):
|
||||
type=[str(Task.TaskTypes.data_processing)],
|
||||
tags=tags or None,
|
||||
status=['stopped', 'published', 'completed', 'closed'] if only_completed else None,
|
||||
only_fields=['created', 'id', 'name', 'project']
|
||||
only_fields=['created', 'id', 'name', 'project', 'tags']
|
||||
)
|
||||
project_ids = {d.project for d in datasets}
|
||||
# noinspection PyProtectedMember
|
||||
project_id_lookup = {d: Task._get_project_name(d) for d in project_ids}
|
||||
return [
|
||||
{'name': d.name, 'created': d.created, 'project': project_id_lookup[d.project], 'id': d.id}
|
||||
{'name': d.name,
|
||||
'created': d.created,
|
||||
'project': project_id_lookup[d.project],
|
||||
'id': d.id,
|
||||
'tags': d.tags}
|
||||
for d in datasets
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user