get_historical_features (Dask/File) silently drops entity_df rows sharing a join key and timestamp
- Dominant language
- Python
- Stars
- 7.3k
- Forks
- 1.4k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 15
Description
## Expected Behavior
get_historical_features() should return exactly one output row per row in the input entity_df, regardless of whether some rows share a join key and event timestamp with other rows. Two entity_df rows with the same (join key, timestamp) but different other columns are distinct requests, not duplicates - e.g. two orders placed by the same customer in the same logged second.
## Current Behavior
On the Dask/File offline store, entity_df rows that share a join key and event timestamp are silently collapsed into one, discarding every other column of the dropped rows (labels, order ids, anything the caller attached to the request).
The DuckDB offline store, and every SQL-based offline store (BigQuery, Snowflake, Redshift, Postgres, Spark, ClickHouse, Trino, Couchbase, Athena), already avoid this by carrying a per-row "entity_row_unique_id" through their generated queries. Dask/File has no equivalent, so it is the only backend where this data loss happens.
## Steps to reproduce
Build an entity_df with 3 rows for get_historical_features: two rows share the same join key and event_timestamp but have different values in another column (e.g. an order_id and a label), and a third row is a different entity. Call get_historical_features() against a Dask/File-backed FeatureStore. The result has only 2 rows - one of the two same-timestamp rows is missing along with its order_id and label. Running the identical entity_df against a DuckDB-backed offline store returns all 3 rows correctly.
### Specifications
- Version: master
- Platform: any (Dask/File offline store specifically; DuckDB and SQL-based stores are unaffected)
- Subsystem: offline store / historical retrieval
## Possible Solution
Tag each entity_df row with a synthetic unique id before the per-feature-view join in dask.py, and deduplicate on that id instead of (join keys, event timestamp) - mirroring the entity_row_unique_id technique already used by the SQL-based offline stores. Submitted as a PR alongside this issue.
FIX:- #6786
Contributor guide
Research direction
Start in dask.py at the Dask/File historical feature retrieval and reproduce the three-row entity_df case described in the issue. Compare its row handling with the SQL-based offline stores' entity_row_unique_id approach. Done means duplicate join-key/timestamp rows retain their distinct columns and all three rows are returned.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-engineering
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100