Skip to content

Fix Traceback when rolling back session#605

Merged
soininen merged 1 commit intomasterfrom
fix_rollback_session
Jan 8, 2026
Merged

Fix Traceback when rolling back session#605
soininen merged 1 commit intomasterfrom
fix_rollback_session

Conversation

@soininen
Copy link
Contributor

@soininen soininen commented Jan 7, 2026

This fixes a Traceback when calling rollback_session() after purging a database and adding items with same unique keys as the purged ones.

No associated issue.

Checklist before merging

  • Documentation (also in Toolbox repo) is up-to-date
  • Release notes have been updated
  • Unit tests have been added/updated accordingly
  • Code has been formatted by black & isort
  • Unit tests pass

When marking an item as updated, we must also set its backup field to
something useful. Otherwise, rollback_session() will fail to
restore the said backup.
@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

❌ Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.68%. Comparing base (bc58e16) to head (4671b99).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
spinedb_api/db_mapping_base.py 78.57% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #605      +/-   ##
==========================================
+ Coverage   85.66%   85.68%   +0.02%     
==========================================
  Files          81       81              
  Lines       11029    11034       +5     
  Branches     1623     1623              
==========================================
+ Hits         9448     9455       +7     
+ Misses       1224     1223       -1     
+ Partials      357      356       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@soininen soininen merged commit e70a756 into master Jan 8, 2026
14 of 15 checks passed
@soininen soininen deleted the fix_rollback_session branch January 8, 2026 06:08
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.

1 participant