Skip to content

Conversation

@geoHeil
Copy link
Collaborator

@geoHeil geoHeil commented Dec 7, 2025

resolves: #245

Copy link
Collaborator Author

geoHeil commented Dec 7, 2025

@geoHeil geoHeil marked this pull request as ready for review December 7, 2025 18:39
@geoHeil geoHeil mentioned this pull request Dec 7, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2025

Coverage

Coverage Report (Python 3.11) •
FileStmtsMissCoverMissing
_testing/parametric
   metadata.py1553776%124–125, 130, 133, 135–136, 138, 141, 147–149, 151, 155–156, 158–159, 164–165, 168–169, 171, 174, 176, 326, 361, 532, 585, 598, 608, 613, 615, 743–745, 750, 759, 787
ext/sqlmodel
   plugin.py1383376%116–118, 193–194, 198, 200, 202–204, 206, 208, 211, 214, 216–217, 220–221, 224–226, 229, 233, 482, 489, 492–493, 511, 516, 522, 532, 534–535
metadata_store
   base.py47614569%3, 5–9, 11–15, 17–19, 25–27, 32, 36, 49–51, 56–58, 65, 68, 87, 89, 94, 99, 105, 110, 122, 150, 157, 160, 162, 232–233, 246–247, 260, 381, 442, 465, 551, 653, 710, 739, 741–742, 802, 879, 962–963, 1006–1007, 1010–1011, 1028, 1058–1059, 1064–1065, 1086, 1091, 1103, 1108, 1140, 1157, 1175, 1186, 1200, 1224, 1238, 1242, 1255, 1265–1266, 1290, 1317, 1352, 1386, 1443, 1517, 1533, 1540, 1548, 1554, 1558, 1578, 1625, 1654, 1679, 1713, 1739, 1752, 1754, 1811, 1890, 1892, 1895–1896, 1899–1900, 1904, 1914, 1927, 1929, 1931–1933, 1938–1939, 1942–1943, 1945–1947, 1949, 1952–1953, 1956–1959, 1962, 1971–1972, 1974–1975, 1978, 1981, 1983–1985, 1989–1990, 1993–1995, 1998, 2000, 2004
models
   constants.py34325%6, 9, 12, 18–19, 21–22, 24–25, 27–28, 30–31, 33–34, 43–44, 49–50, 52–53, 55–56, 58–59, 63, 77, 80, 96, 110, 128, 152
versioning
   engine.py2055274%1, 3–7, 9–10, 12–13, 19–24, 32, 48, 55–56, 58, 60–61, 68–69, 74, 83, 100–105, 109, 123, 141, 177, 290, 412, 418, 454, 550, 585, 589, 613, 658, 711, 730, 733, 755, 759, 764
   upstream_preparer.py57198%146
TOTAL8598339760% 

Tests Skipped Failures Errors Time
1969 22 💤 0 ❌ 0 🔥 6m 35s ⏱️

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2025

Coverage

Coverage Report (Python 3.13) •
FileStmtsMissCoverMissing
_testing/parametric
   metadata.py1553776%124–125, 130, 133, 135–136, 138, 141, 147–149, 151, 155–156, 158–159, 164–165, 168–169, 171, 174, 176, 326, 361, 532, 585, 598, 608, 613, 615, 743–745, 750, 759, 787
ext/sqlmodel
   plugin.py1383376%116–118, 193–194, 198, 200, 202–204, 206, 208, 211, 214, 216–217, 220–221, 224–226, 229, 233, 482, 489, 492–493, 511, 516, 522, 532, 534–535
metadata_store
   base.py47614569%3, 5–9, 11–15, 17–19, 25–27, 32, 36, 49–51, 56–58, 65, 68, 87, 89, 94, 99, 105, 110, 122, 150, 157, 160, 162, 232–233, 246–247, 260, 381, 442, 465, 551, 653, 710, 739, 741–742, 802, 879, 962–963, 1006–1007, 1010–1011, 1028, 1058–1059, 1064–1065, 1086, 1091, 1103, 1108, 1140, 1157, 1175, 1186, 1200, 1224, 1238, 1242, 1255, 1265–1266, 1290, 1317, 1352, 1386, 1443, 1517, 1533, 1540, 1548, 1554, 1558, 1578, 1625, 1654, 1679, 1713, 1739, 1752, 1754, 1811, 1890, 1892, 1895–1896, 1899–1900, 1904, 1914, 1927, 1929, 1931–1933, 1938–1939, 1942–1943, 1945–1947, 1949, 1952–1953, 1956–1959, 1962, 1971–1972, 1974–1975, 1978, 1981, 1983–1985, 1989–1990, 1993–1995, 1998, 2000, 2004
models
   constants.py34325%6, 9, 12, 18–19, 21–22, 24–25, 27–28, 30–31, 33–34, 43–44, 49–50, 52–53, 55–56, 58–59, 63, 77, 80, 96, 110, 128, 152
versioning
   engine.py2055274%1, 3–7, 9–10, 12–13, 19–24, 32, 48, 55–56, 58, 60–61, 68–69, 74, 83, 100–105, 109, 123, 141, 177, 290, 412, 418, 454, 550, 585, 589, 613, 658, 711, 730, 733, 755, 759, 764
   upstream_preparer.py57198%146
TOTAL8598339760% 

Tests Skipped Failures Errors Time
1969 22 💤 0 ❌ 0 🔥 7m 26s ⏱️

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2025

Coverage

Coverage Report (Python 3.12) •
FileStmtsMissCoverMissing
_testing/parametric
   metadata.py1553776%124–125, 130, 133, 135–136, 138, 141, 147–149, 151, 155–156, 158–159, 164–165, 168–169, 171, 174, 176, 326, 361, 532, 585, 598, 608, 613, 615, 743–745, 750, 759, 787
ext/sqlmodel
   plugin.py1383376%116–118, 193–194, 198, 200, 202–204, 206, 208, 211, 214, 216–217, 220–221, 224–226, 229, 233, 482, 489, 492–493, 511, 516, 522, 532, 534–535
metadata_store
   base.py47614569%3, 5–9, 11–15, 17–19, 25–27, 32, 36, 49–51, 56–58, 65, 68, 87, 89, 94, 99, 105, 110, 122, 150, 157, 160, 162, 232–233, 246–247, 260, 381, 442, 465, 551, 653, 710, 739, 741–742, 802, 879, 962–963, 1006–1007, 1010–1011, 1028, 1058–1059, 1064–1065, 1086, 1091, 1103, 1108, 1140, 1157, 1175, 1186, 1200, 1224, 1238, 1242, 1255, 1265–1266, 1290, 1317, 1352, 1386, 1443, 1517, 1533, 1540, 1548, 1554, 1558, 1578, 1625, 1654, 1679, 1713, 1739, 1752, 1754, 1811, 1890, 1892, 1895–1896, 1899–1900, 1904, 1914, 1927, 1929, 1931–1933, 1938–1939, 1942–1943, 1945–1947, 1949, 1952–1953, 1956–1959, 1962, 1971–1972, 1974–1975, 1978, 1981, 1983–1985, 1989–1990, 1993–1995, 1998, 2000, 2004
models
   constants.py34325%6, 9, 12, 18–19, 21–22, 24–25, 27–28, 30–31, 33–34, 43–44, 49–50, 52–53, 55–56, 58–59, 63, 77, 80, 96, 110, 128, 152
versioning
   engine.py2055274%1, 3–7, 9–10, 12–13, 19–24, 32, 48, 55–56, 58, 60–61, 68–69, 74, 83, 100–105, 109, 123, 141, 177, 290, 412, 418, 454, 550, 585, 589, 613, 658, 711, 730, 733, 755, 759, 764
   upstream_preparer.py57198%146
TOTAL8598339760% 

Tests Skipped Failures Errors Time
1969 22 💤 0 ❌ 0 🔥 7m 40s ⏱️

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2025

Test Results (Python 3.10)

1 969 tests   1 947 ✅  6m 33s ⏱️
    1 suites     22 💤
    1 files        0 ❌

Results for commit ab1b584.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2025

Coverage

Coverage Report (Python 3.10) •
FileStmtsMissCoverMissing
_testing/parametric
   metadata.py1553776%124–125, 130, 133, 135–136, 138, 141, 147–149, 151, 155–156, 158–159, 164–165, 168–169, 171, 174, 176, 326, 361, 532, 585, 598, 608, 613, 615, 743–745, 750, 759, 787
ext/sqlmodel
   plugin.py1383376%116–118, 193–194, 198, 200, 202–204, 206, 208, 211, 214, 216–217, 220–221, 224–226, 229, 233, 482, 489, 492–493, 511, 516, 522, 532, 534–535
metadata_store
   base.py47614569%3, 5–9, 11–15, 17–19, 25–27, 32, 36, 49–51, 56–58, 65, 68, 87, 89, 94, 99, 105, 110, 122, 150, 157, 160, 162, 232–233, 246–247, 260, 381, 442, 465, 551, 653, 710, 739, 741–742, 802, 879, 962–963, 1006–1007, 1010–1011, 1028, 1058–1059, 1064–1065, 1086, 1091, 1103, 1108, 1140, 1157, 1175, 1186, 1200, 1224, 1238, 1242, 1255, 1265–1266, 1290, 1317, 1352, 1386, 1443, 1517, 1533, 1540, 1548, 1554, 1558, 1578, 1625, 1654, 1679, 1713, 1739, 1752, 1754, 1811, 1890, 1892, 1895–1896, 1899–1900, 1904, 1914, 1927, 1929, 1931–1933, 1938–1939, 1942–1943, 1945–1947, 1949, 1952–1953, 1956–1959, 1962, 1971–1972, 1974–1975, 1978, 1981, 1983–1985, 1989–1990, 1993–1995, 1998, 2000, 2004
models
   constants.py34325%6, 9, 12, 18–19, 21–22, 24–25, 27–28, 30–31, 33–34, 43–44, 49–50, 52–53, 55–56, 58–59, 63, 77, 80, 96, 110, 128, 152
versioning
   engine.py2055274%1, 3–7, 9–10, 12–13, 19–24, 32, 48, 55–56, 58, 60–61, 68–69, 74, 83, 100–105, 109, 123, 141, 177, 290, 412, 418, 454, 550, 585, 589, 613, 658, 711, 730, 733, 755, 759, 764
   upstream_preparer.py57198%146
TOTAL8598339760% 

Tests Skipped Failures Errors Time
1969 22 💤 0 ❌ 0 🔥 6m 33s ⏱️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements soft-delete functionality for metadata rows, allowing rows to be marked as deleted via a timestamp without physical removal from the store.

  • Adds a new metaxy_deleted_at column that defaults to NULL for active rows
  • By default, soft-deleted rows are filtered out in read_metadata() calls
  • Adds an include_deleted parameter to opt-in to viewing deleted rows
  • Ensures backward compatibility with legacy data that lacks the new column

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/metaxy/models/constants.py Adds METAXY_DELETED_AT constant and includes it in system column sets
src/metaxy/metadata_store/base.py Implements soft-delete filtering logic in read_metadata() and adds default NULL value in _add_system_columns()
src/metaxy/versioning/engine.py Adds METAXY_DELETED_AT to allowed system columns for upstream joins and moves imports to top
src/metaxy/metadata_store/ibis.py Adds .lazy() call to ensure consistent LazyFrame behavior with Narwhals
tests/metadata_stores/test_provenance_golden_reference.py Adds comprehensive test for soft-delete behavior with tombstone records
src/metaxy/_testing/parametric/metadata.py Updates test helpers to include metaxy_deleted_at column with NULL default
tests/ext/__snapshots__/test_sqlmodel.ambr Updates snapshots to include the new metaxy_deleted_at field in all records

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@danielgafni danielgafni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good overall! Just small comments

@danielgafni danielgafni changed the title soft-deletes [core] add metaxy_deleted_at column Dec 8, 2025
@geoHeil geoHeil force-pushed the 12-07-soft-deletes branch from f892f10 to 5aed737 Compare December 8, 2025 12:39
Copy link
Collaborator

@danielgafni danielgafni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@geoHeil geoHeil requested review from danielgafni and removed request for danielgafni December 8, 2025 13:05
@geoHeil
Copy link
Collaborator Author

geoHeil commented Dec 8, 2025

should we already merge this or get the whole stack ready first?

Copy link
Collaborator

@danielgafni danielgafni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually @geoHeil the sqlalchemy and sqlmodel plugins and tests have to be updated as well

@geoHeil geoHeil force-pushed the 12-07-soft-deletes branch 2 times, most recently from ca79e46 to 1a920c5 Compare December 8, 2025 15:57
@geoHeil geoHeil requested a review from danielgafni December 8, 2025 15:57
@geoHeil
Copy link
Collaborator Author

geoHeil commented Dec 8, 2025

Actually @geoHeil the sqlalchemy and sqlmodel plugins and tests have to be updated as well

added - tests were green. would we need any additional tests or is that good?

@geoHeil geoHeil force-pushed the 12-07-soft-deletes branch 2 times, most recently from 16e3d71 to 1a9d523 Compare December 8, 2025 20:01
@danielgafni
Copy link
Collaborator

danielgafni commented Dec 8, 2025

wrong PR sorry

@geoHeil geoHeil force-pushed the 12-07-soft-deletes branch from 1a9d523 to 22465e0 Compare December 9, 2025 07:16
Copy link
Collaborator

@danielgafni danielgafni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok cool, let's merge it a little later as part of the whole stack - I don't want to redo my migrations for Anam's prod right now

@geoHeil geoHeil force-pushed the 12-07-soft-deletes branch 5 times, most recently from b29bc0b to 01ee00e Compare December 10, 2025 16:09
allow_fallback: If `True`, check fallback stores on local miss
current_only: If `True`, only return rows with current feature_version
latest_only: Whether to deduplicate samples within `id_columns` groups ordered by `metaxy_created_at`.
include_soft_deleted: If `True`, include soft-deleted rows in the result.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth noting that previous historical materializations of the same feature version will be effectively removed from the output as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean like:

include_soft_deleted: If `True`, include soft-deleted rows in the result. Previous historical materializations of the same feature version will be effectively removed from the output otherwise.

@geoHeil geoHeil force-pushed the 12-07-soft-deletes branch 2 times, most recently from a308098 to 5e9126b Compare December 19, 2025 09:34
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.

[core] Enable historical metadata cleanup

3 participants