Skip to content

fix: Keep the new event range of an overwritten SavedDataset - #7212

Open
ShivamSharma43 wants to merge 1 commit into
feast-dev:masterfrom
ShivamSharma43:fix/saved-dataset-timestamps
Open

ShivamSharma43 wants to merge 1 commit into
feast-dev:masterfrom
ShivamSharma43:fix/saved-dataset-timestamps

Conversation

@ShivamSharma43

@ShivamSharma43 ShivamSharma43 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

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's min_event_timestamp and max_event_timestamp from the new retrieval job. When the dataset already exists, Registry.apply_saved_dataset replaces both with the stored values. get_saved_dataset then filters the new data by the old range. Saving the same dataset twice from a local store:

rows written rows read by get_saved_dataset before after
first save, days 1-3 3 3 3
overwrite with days 11-13 3 0 3

If 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_proto also never wrote last_updated_timestamp, so it was always None when read back, although the registries set it and from_proto reads it. It's written now.

Which issue(s) this PR fixes:

No issue filed; found while reading the registry code.

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

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 SQLite sql registry 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 check and ruff format are clean. mypy on 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


Devin Review

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>
@ShivamSharma43
ShivamSharma43 requested a review from a team as a code owner November 22, 2026 17:41
Copilot AI balanced review requested due to automatic review settings November 22, 2026 17:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-commenter

codecov-commenter commented Nov 22, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.97%. Comparing base (3ece12f) to head (c63f524).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
go-feature-server 30.96% <ø> (ø)
python-unit 55.57% <100.00%> (+0.03%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/infra/registry/registry.py 66.37% <100.00%> (+1.11%) ⬆️
sdk/python/feast/saved_dataset.py 70.95% <100.00%> (+5.08%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ece12f...c63f524. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

Comment on lines +1295 to +1306
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()
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

This branch has not been deployed

No deployments
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.

3 participants