refactor(dedup): retire defensive keep="last" on ArcticDB reads (L2188)#206
Merged
Merged
Conversation
Remove the defensive `keep="last"` index dedup from both the training read path (`data/dataset.py::_load_ticker_parquet`) and the inference read path (`inference/stages/load_prices.py::_read_ohlcv` + `_read_close`). The dedup was a 2026-04-15 transition device added to mask same-date duplicate rows ArcticDB was emitting at the time. The upstream fix (alpha-engine-data builders/daily_append.py → `update()` over `append()`) shipped same day, and 6+ weeks of clean Saturday + weekday cycles have verified the write path is now duplicate-free. Per feedback_no_silent_fails: a silent `keep="last"` on values-differ duplicates would mask an upstream write-path regression as a clean read. The right surface for any future re-recurrence is the downstream pandas reindex raising — which fails the pipeline loudly at the first feature computation site (`compute_features`). Tests: - `TestDefensiveDedupRetiredL2188::test_dataset_loader_does_not_dedup` — source-level pin that `_load_ticker_parquet` carries no `.duplicated(` call. - `TestDefensiveDedupRetiredL2188::test_inference_readers_do_not_dedup` — same pin for `load_price_data_from_arctic`. Note: `data/dataset.py:215` retains `.duplicated(keep="first")` for a DIFFERENT purpose (cross-source merge first-wins semantics, not defensive dedup); intentionally out of scope. Suite: 1216 passed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove the defensive
keep=\"last\"index dedup from both the training read path (data/dataset.py::_load_ticker_parquet) and the inference read path (inference/stages/load_prices.py::_read_ohlcv+_read_close). Add source-level pin tests so the dead defense can't silently re-appear.Why
The dedup was a 2026-04-15 transition device added to mask same-date duplicate rows ArcticDB was emitting at the time. The upstream fix (alpha-engine-data
builders/daily_append.py→update()overappend()) shipped the same day, and 6+ weeks of clean Saturday + weekday cycles have verified the write path is now duplicate-free.Per
[[feedback_no_silent_fails]]: a silentkeep=\"last\"on values-differ duplicates would mask an upstream write-path regression as a clean read. The right surface for any future re-recurrence is the downstream pandasreindexraising — which fails the pipeline loudly at the firstcompute_featurescall site.ROADMAP: L2188 — Phase 7a follow-up: remove defensive
keep=\"last\"dedup.Out of scope
data/dataset.py:215retains.duplicated(keep=\"first\")for a different purpose (cross-source merge first-wins semantics, not defensive dedup). Intentionally left alone.Test plan
TestDefensiveDedupRetiredL2188) block re-introduction1216 passed🤖 Generated with Claude Code