Skip to content

Commit

Permalink
Guard against immutable ID not being returned from create collection (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs authored Oct 12, 2024
1 parent 7376b54 commit 382d9b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/datalab_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def create_item(
try:
collection_immutable_id = self.get_collection(collection_id)["immutable_id"]
except RuntimeError:
collection_immutable_id = self.create_collection(collection_id)["immutable_id"]
self.create_collection(collection_id)
collection_immutable_id = self.get_collection(collection_id)["immutable_id"]
new_item["collections"] = new_item.get("collections", [])
new_item["collections"].append({"immutable_id": collection_immutable_id})

Expand Down

0 comments on commit 382d9b4

Please sign in to comment.