Skip to content

Commit

Permalink
skip updating empty collection
Browse files Browse the repository at this point in the history
  • Loading branch information
FynnBe committed Jun 11, 2024
1 parent 4b6993c commit acd91f1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions bioimageio_collection_backoffice/remote_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,12 @@ def generate_collection_json(
# if not isinstance(coll_descr, CollectionDescr):
# raise ValueError(coll_descr.validation_summary.format())

self.client.put_json(
output_file_name, collection.model_dump(mode="json", exclude_none=True)
)
if entries:
self.client.put_json(
output_file_name, collection.model_dump(mode="json", exclude_none=True)
)
else:
logger.error("Skipping uploading empty collection!")

# raise an error for an invalid (skipped) collection entry
if error_in_published_entry is not None:
Expand Down Expand Up @@ -1105,7 +1108,9 @@ def maybe_swap_with_thumbnail(
for d in [v.client.load_file(v.rdf_path) for v in versions]
]
entry_dois = [v.doi for v in versions]
legacy_download_count = LEGACY_DOWNLOAD_COUNTS.get(rdf["id"], 0) # TODO: add download count from versions
legacy_download_count = LEGACY_DOWNLOAD_COUNTS.get(
rdf["id"], 0
) # TODO: add download count from versions

if rdf["id"].startswith("10.5281/zenodo."):
# legacy models
Expand Down

0 comments on commit acd91f1

Please sign in to comment.