FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: Break event timestamp ties by created timestamp in the Dask offline store by LuisFigueroaG · Pull Request #6952 · feast-dev/feast · GitHub

Repository navigation

fix: Break event timestamp ties by created timestamp in the Dask offline store - #6952

Open
LuisFigueroaG wants to merge 1 commit into
feast-dev:masterfrom
LuisFigueroaG:fix/dask-created-timestamp-tiebreak
Open

LuisFigueroaG wants to merge 1 commit into
feast-dev:masterfrom
LuisFigueroaG:fix/dask-created-timestamp-tiebreak

Conversation

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

When two rows share an event timestamp, Feast is supposed to keep the one with the latest created_timestamp_column. The Dask offline store did this with two consecutive sorts, first by the created timestamp and then by the event timestamp, and relied on the second sort preserving the order of the first:

df_to_join = df_to_join.sort_values(by=created_timestamp_column, na_position="first")
df_to_join = df_to_join.sort_values(by=timestamp_field, na_position="first")

Dask's sort_values (and pandas' default quicksort) is not stable, so for tied event timestamps the older row can end up last and win drop_duplicates(keep="last"). With 300 entities, each having two rows with the same event timestamp, 291 came back with the older row. A single partition with 20 entities already returned 12 wrong rows. This affects get_historical_features (_drop_duplicates) and pull_latest_from_table_or_query (evaluate_offline_job).

This sorts once by [timestamp_field, created_timestamp_column] in both places, including the ZeroDivisionError fallbacks. Multi-column sort_values is supported by dask since well before the dask>=2024.2.1 minimum.

Which issue(s) this PR fixes:

No existing issue.

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

Added test_dask_created_timestamp_tiebreak.py, covering get_historical_features and pull_latest_from_table_or_query with 100 entities across 4 partitions. Both tests failed in 5 out of 5 runs on master and pass with this change. ruff format --check, ruff check and mypy pass on the changed files, and sdk/python/tests/unit/infra/offline_stores/ passes (291 passed).

…ine store

The Dask offline store sorted by created_timestamp_column and then by
timestamp_field in a second pass, relying on that second sort to keep
the created timestamp order for rows sharing an event timestamp.
sort_values is not stable, so with enough rows the older row could end
up last and win the keep="last" deduplication, both in historical
retrieval and in pull_latest_from_table_or_query.

Sort once by [timestamp_field, created_timestamp_column] instead.

Signed-off-by: LuisFigueroaG <luis.h.figueroa.g@gmail.com>
LuisFigueroaG requested a review from a team as a code owner October 6, 2026 01:27

codecov-commenter commented Oct 7, 2026 •
edited
Loading

Copy link
Copy Markdown

⚠️ Please install the to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 49.05%. Comparing base (acadb17) to head (a6f2696).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
sdk/python/feast/infra/offline_stores/dask.py 90.90% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

@@           Coverage Diff           @@
##           master    #6952   +/-   ##
=======================================
  Coverage   49.04%   49.05%           
=======================================
  Files         433      433           
  Lines       54308    54304    -4     
  Branches     7910     7908    -2     
=======================================
+ Hits        26637    26640    +3     
+ Misses      25790    25785    -5     
+ Partials     1881     1879    -2     
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 50.45% <90.90%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/infra/offline_stores/dask.py 56.23% <90.90%> (+0.80%) ⬆️

... 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 acadb17...a6f2696. 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.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL