Skip to content

fix: plan keeps unattached_rows and rows_in_default when the policy needs facts - #109

Merged
AlexeyShalaev merged 1 commit into
masterfrom
fix/108-measure-keeps-findings
Oct 16, 2026
Merged

AlexeyShalaev merged 1 commit into
masterfrom
fix/108-measure-keeps-findings

Conversation

@AlexeyShalaev

Copy link
Copy Markdown
Member

Closes #108.

measure() rebuilt the tree as ActualTree(root=root, orphans=orphans), dropping unattached and default_earliest, which inspection sets before handing the tree over. A policy that needs facts therefore planned without both findings. It now returns tree.model_copy(update={"root": root, "orphans": orphans}) in both mirrors, so whatever else goes on the tree later survives as well.

The new integration test (both mirrors) plans with the policy from #108 / the foreign-key guide over a past row in DEFAULT and a filled __2025_01 table nobody attached, and expects both findings. With the fix set aside it fails in both mirrors; with it, both pass.

unit 2872 passed, integration (PG 17) 577 passed, ruff and mypy clean.

…eeds facts

measure() rebuilt the tree from its root and orphans, dropping the unattached tables and the earliest DEFAULT row that inspection had put on it. With a policy that reads facts (Unreferenced, SizeAbove, RowsAbove, a SQL predicate) plan never reported either finding. It now returns a copy of the tree with the facts added.

Closes #108
@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@AlexeyShalaev
AlexeyShalaev merged commit a0e8730 into master Oct 16, 2026
32 checks passed
@AlexeyShalaev
AlexeyShalaev deleted the fix/108-measure-keeps-findings branch October 16, 2026 14:39
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.

plan loses the unattached_rows and rows_in_default findings when the lifecycle policy needs facts

1 participant