8000 fix: improve error handling when `make_fetch` referential integrity fails by ttngu207 · Pull Request #1245 · datajoint/datajoint-python · GitHub
[go: up one dir, main page]

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

Conversation

ttngu207
Copy link
Contributor

This pull request modifies the behavior of the _populate1 method in datajoint/autopopulate.py to improve error handling for referential integrity issues.

Error handling changes:

  • Updated the _populate1 method to raise a DataJointError when fetched data changes, replacing the previous behavior of canceling the transaction and logging a warning. This ensures that referential integrity issues are treated as critical errors and handled explicitly.

@github-actions github-actions bot added bug Indicates an unexpected problem or unintended behavior enhancement Indicates new improvements labels Jun 13, 2025
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the _populate1 method in datajoint/autopopulate.py to treat referential integrity failures as critical errors by raising a DataJointError instead of silently rolling back and logging a warning.

  • Removed transaction cancellation and warning on make_fetch data mismatch
  • Added a DataJointError to fail fast on referential integrity issues
Comments suppressed due to low confidence (1)

datajoint/autopopulate.py:415

  • Add a unit test to verify that _populate1 raises DataJointError when the make_fetch data changes, ensuring this new error path is exercised.
):  # raise error if fetched data has changed

@dimitri-yatsenko dimitri-yatsenko merged commit 53e38f7 into datajoint:master Jun 16, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior enhancement Indicates new improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0