mirror of
https://github.com/clearml/clearml
synced 2025-06-26 18:16:07 +00:00
fix: Unhandled None value in project_ids when list all datasets
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
4d6b54d51a
commit
96a10373b1
@ -2094,7 +2094,7 @@ class Dataset(object):
|
||||
exact_match_regex_flag=False,
|
||||
_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
|
||||
project_id_lookup = Task._get_project_names(list(project_ids))
|
||||
return [
|
||||
@ -2106,7 +2106,7 @@ class Dataset(object):
|
||||
"tags": d.tags,
|
||||
"version": d.runtime.get("version"),
|
||||
}
|
||||
for d in datasets
|
||||
for d in datasets if d.project is not None
|
||||
]
|
||||
|
||||
def _add_files(
|
||||
|
Loading…
Reference in New Issue
Block a user