-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Part table not caught by delete_downstream_parts
#1064
Comments
Did you try importing |
thanks, i was able to get past that error and now i have this one. i did import "SortedSpikesGroup" but i still get this error. im not sure how to import the parts table SortedSpikesGroup.Unit Error stack---------------------------------------------------------------------------
DataJointError Traceback (most recent call last)
Cell In [14], line 5
3 import spyglass.spikesorting.v1 as sgs
4 del_key = {"nwb_file_name": 'RS1020240627_.nwb'}
----> 5 sgs.SortGroup.delete(del_key)
File ~/spyglass/src/spyglass/utils/dj_mixin.py:695, in SpyglassMixin.delete(self, *args, **kwargs)
693 def delete(self, *args, **kwargs):
694 """Alias for cautious_delete, overwrites datajoint.table.Table.delete"""
--> 695 self.cautious_delete(*args, **kwargs)
File ~/spyglass/src/spyglass/utils/dj_mixin.py:675, in SpyglassMixin.cautious_delete(self, force_permission, dry_run, *args, **kwargs)
667 if dry_run:
668 return (
669 down_fts,
670 IntervalList(), # cleanup func relies on downstream deletes
671 external["raw"].unused(),
672 external["analysis"].unused(),
673 )
--> 675 if not self._commit_downstream_delete(down_fts, start=start, **kwargs):
676 return # Abort delete based on user input
678 super().delete(*args, **kwargs) # Confirmation here
File ~/spyglass/src/spyglass/utils/dj_mixin.py:377, in SpyglassMixin._commit_downstream_delete(self, down_fts, start, **kwargs)
371 if (
372 self._test_mode
373 or not safemode
374 or user_choice("Commit deletes?", default="no") == "yes"
375 ):
376 for down_ft in down_fts: # safemode off b/c already checked
--> 377 down_ft.delete(safemode=False, **kwargs)
378 else:
379 logger.info("Delete aborted.")
File ~/anaconda3/envs/spyglass2/lib/python3.9/site-packages/datajoint/table.py:574, in Table.delete(self, transaction, safemode, force_parts)
572 if transaction:
573 self.connection.cancel_transaction()
--> 574 raise DataJointError(
575 "Attempt to delete part table {part} before deleting from "
576 "its master {master} first.".format(part=part, master=master)
577 )
579 # Confirm and commit
580 if delete_count == 0:
DataJointError: Attempt to delete part table `spikesorting_group_v1`.`sorted_spikes_group__units` before deleting from its master `spikesorting_group_v1`.`sorted_spikes_group` first. |
delete_downstream_parts
Hi @MichaelCoulter - Thanks for reporting. The part delete error is one that would be avoided entirely by my pending PR to DataJoint. I'm hoping we can get that merged this week. In the short term, this error is asking you to delete from |
im trying to perform this delete:
and i get this error. any help is appreciated.
Error stack
The text was updated successfully, but these errors were encountered: