Skip to content

Commit 96691c3

Browse files
samuelbray32CBroz1
andauthored
Fix bug on empty delete in merge table (#940)
* fix bug on empty delete in merge table * update changelog * fix spelling --------- Co-authored-by: Chris Brozdowski <[email protected]>
1 parent 664f051 commit 96691c3

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
- Prioritize datajoint filepath entry for defining abs_path of analysis nwbfile
1717
#918
1818
- Fix potential duplicate entries in Merge part tables #922
19+
- Add logging of AnalysisNwbfile creation time and size #937
20+
- Fix error on empty delete call in merge table. #940
1921
- Add log of AnalysisNwbfile creation time, size, and access count #937, #941
2022

2123
### Pipelines

src/spyglass/utils/dj_merge_tables.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -799,11 +799,16 @@ def merge_populate(self, source: str, keys=None):
799799

800800
def delete(self, force_permission=False, *args, **kwargs):
801801
"""Alias for cautious_delete, overwrites datajoint.table.Table.delete"""
802-
for part in self.merge_get_part(
803-
restriction=self.restriction,
804-
multi_source=True,
805-
return_empties=False,
802+
if not (
803+
parts := self.merge_get_part(
804+
restriction=self.restriction,
805+
multi_source=True,
806+
return_empties=False,
807+
)
806808
):
809+
return
810+
811+
for part in parts:
807812
part.delete(force_permission=force_permission, *args, **kwargs)
808813

809814
def super_delete(self, warn=True, *args, **kwargs):

0 commit comments

Comments
 (0)