CalculateEstimatedDates: handle ancestry-loop DatabaseError (bug 0007898) - #7
Closed
eduralph wants to merge 1 commit into
Closed
CalculateEstimatedDates: handle ancestry-loop DatabaseError (bug 0007898)#7eduralph wants to merge 1 commit into
eduralph wants to merge 1 commit into
Conversation
…n (bug 0007898) probably_alive_range raises DatabaseError when it detects loops in ancestor or descendant chains. Previously this propagated out of the removal, selection, and apply loops and tore down the entire tool, leaving signals disabled and the progress dialog stuck open. Wrap each per-person iteration with try/except so a single bad record is logged and skipped, and add outer try/finally blocks so signals are re-enabled and the progress dialog is closed even on unexpected failures. Surface a "Skipped N people due to errors" message to the user when any rows were skipped. Add unit tests covering get_modifier branches, calc_estimates happy path, DatabaseError propagation from calc_estimates, and .gpr.py registration metadata. The addon module is loaded lazily inside a fixture so pytest collection succeeds even when the GUI stack cannot import. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
eduralph
force-pushed
the
fix/calculateestimateddates-gramps-id-7898
branch
from
April 18, 2026 00:08
2b168b5 to
a2136d7
Compare
Owner
Author
|
Superseded — opening upstream PR against gramps-project/addons-source. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
probably_alive_rangeraisesDatabaseErroron a family-tree loop (ancestor or descendant cycle).try/exceptso a single bad record is logged viaLOG.warningand skipped instead of tearing down the tool.try/finallyblocks so signals are re-enabled and the progress dialog is closed even on unexpected failures, and surfaces a "Skipped N people due to errors" message to the user.get_modifier,calc_estimates(happy path +DatabaseErrorpropagation), and.gpr.pyregistration metadata. The addon module is loaded lazily inside a fixture so collection succeeds even when the GUI stack cannot import.Test plan
python3 -m pytest CalculateEstimatedDates/tests/test_calculate_estimated_dates.py::test_gpr_registration_metadata -vpasses locally🤖 Generated with Claude Code