mirror of
https://github.com/clearml/clearml
synced 2025-06-26 18:16:07 +00:00
Fix unhandled None
value in project IDs when listing all datasets (#1413)
When fetching the project_ids, there are times where the project id may be None, even if that's not supposed to be the case. This causes the program to break. This patch adds some defensive checks to make sure that even if somehow we get None for the project_id, it will be ignored and handled gracefully.
This commit is contained in:
parent
afbbd3975a
commit
25df3b4c75
@ -2094,7 +2094,7 @@ class Dataset(object):
|
|||||||
exact_match_regex_flag=False,
|
exact_match_regex_flag=False,
|
||||||
_allow_extra_fields_=True,
|
_allow_extra_fields_=True,
|
||||||
)
|
)
|
||||||
project_ids = {d.project for d in datasets}
|
project_ids = {d.project for d in datasets if d.project is not None}
|
||||||
# noinspection PyProtectedMember
|
# noinspection PyProtectedMember
|
||||||
project_id_lookup = Task._get_project_names(list(project_ids))
|
project_id_lookup = Task._get_project_names(list(project_ids))
|
||||||
return [
|
return [
|
||||||
@ -2106,7 +2106,7 @@ class Dataset(object):
|
|||||||
"tags": d.tags,
|
"tags": d.tags,
|
||||||
"version": d.runtime.get("version"),
|
"version": d.runtime.get("version"),
|
||||||
}
|
}
|
||||||
for d in datasets
|
for d in datasets if d.project is not None
|
||||||
]
|
]
|
||||||
|
|
||||||
def _add_files(
|
def _add_files(
|
||||||
|
Loading…
Reference in New Issue
Block a user