LorenFrankLab / spyglass

Neuroscience data analysis framework for reproducible research built by Loren Frank Lab at UCSF
https://lorenfranklab.github.io/spyglass/
MIT License
94 stars 42 forks source link

Maybe there are still some lock issues with ArtifactRemovedIntervalList()? #1184

Closed shijiegu closed 2 days ago

shijiegu commented 2 days ago

Describe the bug

(ArtifactRemovedIntervalList() & {'nwb_file_name' : haydn20230603_.nwb,
                                  "artifact_params_name":"ampl_1500_prop_075_1ms"}).delete()

hangs a long time (>1h) and is still hanging.

IntervalList() does not have this problem.

shijiegu commented 2 days ago

Upon running the following, I think it is not a problem with the lock but the delete function. I am using an old Spyglass. If the delete on your end works, please delete it for me. Thanks.

(ArtifactRemovedIntervalList() & {'nwb_file_name' : haydn20230603_.nwb,
                                  "artifact_params_name":"ampl_1500_prop_075_1ms"}).delete_quick()

it gave me

IntegrityError: Cannot delete or update a parent row: a foreign key constraint fails (`spikesorting_sorting`.`spike_sorting_selection`, CONSTRAINT `spike_sorting_selection_ibfk_3` FOREIGN KEY (`artifact_removed_interval_list_name`) REFERENCES `spikesorting_artifact`.`artifact_r)
CBroz1 commented 2 days ago

Hi @shijiegu - I would like to reserve GitHub issues for items concerning up-to-date Spyglass. So long as you're using an old version, please either post to GitHub discussions or Slack channels.

Using delete_quick does not cascade deletes. This IntegrityError indicates that there are downstream items that depend on this entry and they will need to be deleted first. DataJoint's delete can handle this for you. Our check_threads feature can distinguish between #1030 and other issues. You might be interested in copying this code to a custom repository