Skip to content

fix: persist_empty must not wipe existing table data - #642

Merged
msiemens merged 1 commit into
msiemens:masterfrom
uadhran:fix/636-persist-empty-no-wipe
Oct 5, 2026
Merged

msiemens merged 1 commit into
msiemens:masterfrom
uadhran:fix/636-persist-empty-no-wipe

Conversation

@uadhran

@uadhran uadhran commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Summary

persist_empty=True always called table.clear() on Table construction, which wiped documents when reopening an existing non-empty table.

Per #636 option (1): only persist a new empty table when there are no documents yet.

Fixes #636

Test plan

  • uv run py.test tests/test_tables.py -q --mypy
  • Existing test_persist_table still passes
  • New regression test: reopen with persist_empty=True keeps data
  • Manual issue repro no longer wipes

Only write an empty table when the table has no documents yet.
Reopening with persist_empty=True no longer clears stored docs.

Fixes msiemens#636
@msiemens

msiemens commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Thanks!

@msiemens
msiemens merged commit 717616b into msiemens:master Oct 5, 2026
31 checks passed
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.

persist_empty=True clears existing table data on Table construction

2 participants