Skip to content

Commit

Permalink
🩹 Handle OSError during delete
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyosun committed Mar 12, 2024
1 parent 7675e96 commit 5ce65b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lamindb/_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,11 @@ def delete(

if delete_record is True:
# need to grab file path before deletion
filepath = filepath_from_artifact(self, using_key)
try:
filepath = filepath_from_artifact(self, using_key)
except OSError:
# we can still delete the record
storage = False
# only delete in storage if DB delete is successful
# DB delete might error because of a foreign key constraint violated etc.
self._delete_skip_storage()
Expand Down

0 comments on commit 5ce65b1

Please sign in to comment.