Skip to content

fix: improve error handling when make_fetch referential integrity fails #1245

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

Merged
merged 3 commits into from
Jun 16, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions datajoint/autopopulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,10 @@ def _populate1(
!= deepdiff.DeepHash(fetched_data, ignore_iterable_order=False)[
fetched_data
]
): # rollback due to referential integrity fail
self.connection.cancel_transaction()
logger.warning(
f"Referential integrity failed for {key} -> {self.target.full_table_name}")
return False
): # raise error if fetched data has changed
raise DataJointError(
"Referential integrity failed - the `make_fetch` data has changed."
)
gen.send(computed_result) # insert

except (KeyboardInterrupt, SystemExit, Exception) as error:
Expand Down
Loading