Repository navigation
Preserve edge and migration metadata when trimming - #3511
Merged
Merged
Conversation
rpinho
added a commit
to rpinho/tskit
that referenced
this pull request
Nov 18, 2026
jeromekelleher-bot
left a comment
There was a problem hiding this comment.
Thanks @rpinho, this is a real data-loss bug: ltrim/trim rebuild the edges and migrations tables with an explicit list of columns that was never updated when those tables gained metadata in 0.3.0, so all edge and migration metadata is silently dropped. I've confirmed the new test fails on main and passes with this change.
As with #3512 and #3514, a few small things before we merge:
- Could you add
:user:`rpinho`to the changelog entry? - Please squash the two commits into one.
- Please remove the
Co-Authored-By: Claude ...andClaude-Session: ...lines from the commit message.
Otherwise LGTM.
rpinho
force-pushed
the
fix-trim-preserve-metadata
branch
from
November 19, 2026 13:21
bd5be6c to
57f87e1
Compare
Contributor
Author
|
Thanks. I changed those. |
rpinho
force-pushed
the
fix-trim-preserve-metadata
branch
from
November 20, 2026 17:53
57f87e1 to
c65a9f8
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3511 +/- ##
=======================================
Coverage 91.72% 91.72%
=======================================
Files 37 37
Lines 30839 30839
Branches 4921 4921
=======================================
Hits 28286 28286
Misses 2223 2223
Partials 330 330
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
jeromekelleher
approved these changes
Nov 21, 2026
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.
Description
ltrimandtrimdiscard metadata attached to edges and migrations. Add metadata to a tree sequence with recorded migrations, keep a region away from position zero and trim the result to reproduce the loss. Pass the metadata and offsets through the table updates that shift the coordinates. The test checks positions, metadata and offsets after both operations.PR Checklist:
🤖 Generated with Claude Code
https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N