Repository navigation
fix: Keep the new event range of an overwritten SavedDataset - #7212
ShivamSharma43 wants to merge 1 commit into
Conversation
Registry.apply_saved_dataset replaced the event range of a re-applied dataset with the stored one, so get_saved_dataset filtered the new data by the old range. Keep the stored range only if the new dataset has none. Also write last_updated_timestamp in SavedDataset.to_proto. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Shivam Sharma <192242476+ShivamSharma43@users.noreply.github.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7212 +/- ##
==========================================
+ Coverage 53.94% 53.97% +0.03%
==========================================
Files 466 466
Lines 58822 58827 +5
Branches 8665 8668 +3
==========================================
+ Hits 31729 31753 +24
+ Misses 24954 24942 -12
+ Partials 2139 2132 -7
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Devin Review found 1 potential issue.
2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
| if saved_dataset.min_event_timestamp is None and existing_meta.HasField( | ||
| "min_event_timestamp" | ||
| ): | ||
| saved_dataset.min_event_timestamp = ( | ||
| existing_meta.min_event_timestamp.ToDatetime() | ||
| ) | ||
| if saved_dataset.max_event_timestamp is None and existing_meta.HasField( | ||
| "max_event_timestamp" | ||
| ): | ||
| saved_dataset.max_event_timestamp = ( | ||
| existing_meta.max_event_timestamp.ToDatetime() | ||
| ) |
There was a problem hiding this comment.
🟡 Dataset preview errors after metadata edits
When a user edits a registered dataset with no event bounds, apply_saved_dataset leaves both bounds unset. The saved dataset reader requires both, so the preview returns HTTP 500 instead of an empty result.
Learn more
Register Dataset registers existing storage without supplying event timestamps, and Edit Dataset sends the same registration request with overwrite enabled. Before this change, editing a registration with no bounds replaced them with epoch timestamps, so the file offline store could execute the preview query, albeit with the wrong range. The new behavior keeps the bounds absent, but retrieve_saved_dataset still converts the lower bound and adds a second to the upper bound unconditionally. The preview endpoint turns the resulting exception into HTTP 500.
Example: Register a Parquet file containing January 2026 rows, then edit only the dataset description and open the sample tab. Before this change, the sample request succeeded with zero rows because it filtered near the epoch. It now fails before querying the file.
Recommended fix: Keep absent bounds absent in the registry. Make PassthroughProvider.retrieve_saved_dataset handle missing bounds explicitly, translating them to unbounded reads where supported. The Dask file store already skips the corresponding filters. Add a regression test for previewing an edited registration without event bounds.
Was this helpful? React with 👍 or 👎 to provide feedback.
What this PR does / why we need it:
With a file-based registry, overwriting a saved dataset makes its new data unreadable.
create_saved_dataset(..., allow_overwrite=True)sets the dataset'smin_event_timestampandmax_event_timestampfrom the new retrieval job. When the dataset already exists,Registry.apply_saved_datasetreplaces both with the stored values.get_saved_datasetthen filters the new data by the old range. Saving the same dataset twice from a local store:get_saved_datasetbeforeIf the stored dataset has no range, the same code stores 1970-01-01 for both timestamps.
The stored range is now kept only when the applied dataset doesn't have its own. Preserving it was added in #4257 for datasets that are re-applied without one, and that still works.
SavedDataset.to_protoalso never wrotelast_updated_timestamp, so it was alwaysNonewhen read back, although the registries set it andfrom_protoreads it. It's written now.Which issue(s) this PR fixes:
No issue filed; found while reading the registry code.
Checks
git commit -s)Testing Strategy
Unit tests
Integration tests
Manual tests
Testing is not required for this change
New
sdk/python/tests/unit/infra/registry/test_saved_dataset_timestamps.py: on master 4 of its 5 cases fail, with the fix all pass. The fifth (a stored range is kept when the new dataset has none) passes both ways.The table comes from a script that saves the dataset twice with a local
FeatureStore(file registry, dask offline store). With a SQLitesqlregistry the same script reads 3 rows before and after.The other file, SQL and proto registry unit tests that could run locally pass (75 passed, 1 skipped). The remote and Snowflake registry tests and the integration tests were not run locally.
ruff checkandruff formatare clean.mypyon the two changed modules reports one error, the same as on master.Misc
This change was prepared with AI assistance (Claude Code), which also ran the tests listed above.
🤖 Generated with Claude Code