Skip to content

Safe inserts of search maps into database#754

Merged
stephen-riggs merged 3 commits intomainfrom
safe-search-map-insert
Mar 5, 2026
Merged

Safe inserts of search maps into database#754
stephen-riggs merged 3 commits intomainfrom
safe-search-map-insert

Conversation

@stephen-riggs
Copy link
Contributor

We currently run a .one() on search maps, grid squares and foil holes in the database.
If there is already one, but the ispyb insert fails we trigger the except clause and end up inserting a second one, which then keeps crashing and inserting more as the .one() fails.

The except on these inserts has been removed in this PR and instead an .all() is run on the values and the first one taken.
If the ispyb update fails this should then fall through to the outer try-except in the feedback.py

@stephen-riggs stephen-riggs requested a review from tieneupin March 5, 2026 10:43
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.00%. Comparing base (26e2f89) to head (235b805).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #754   +/-   ##
=======================================
  Coverage   48.00%   48.00%           
=======================================
  Files          91       91           
  Lines        9909     9909           
  Branches     1278     1281    +3     
=======================================
  Hits         4757     4757           
  Misses       4930     4930           
  Partials      222      222           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stephen-riggs stephen-riggs merged commit 833e9b6 into main Mar 5, 2026
17 checks passed
@stephen-riggs stephen-riggs deleted the safe-search-map-insert branch March 5, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants