fix(data): short-history tickers are first-class, no silent skip#76
Merged
Conversation
Replaces the len(hist) < MIN_ROWS_FOR_FEATURES silent skip in daily_append with an OHLCV-only write. When a ticker has insufficient history for feature warmup (new listings, IPOs, spinoffs — e.g. SNDK post the 2026 WDC flash-memory spinoff) we still write the authoritative close, with NaN for every feature column, and log "short-history ticker=X rows=N" so coverage gaps surface. A dedicated n_partial counter separates this state from n_skip (dry run / NaN close) and n_err (ArcticDB read failures). The 5% err_rate guard is unchanged — partial writes don't count as errors. Root cause traced 2026-04-21: EOD reconcile hard-failed on every held short-history ticker because authoritative close was missing from ArcticDB. New listings are a normal, recurring market event; silently dropping them violates the no-silent-fails, no-unscoreable-labels, and hard-fail-until-stable preferences. Regression test locks the write path + structured log. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
cipher813
added a commit
that referenced
this pull request
Apr 21, 2026
PR #76 hardcoded Volume→int64 in the short-history write path. ArcticDB rejects updates whose column dtypes don't match the existing version, and stored Volume dtype varies across tickers — some int64, some float64, depending on when the symbol was first backfilled. Three short-history tickers (SOLS, ULS, +1) failed the update on 2026-04-21 with FLOAT64/INT64 mismatch, surfacing as n_err=4 in the daily_append summary. Fix: astype every column to hist.dtypes[col] — authoritative by construction, compatible with every ticker regardless of stored schema. No dtype hardcoding anywhere in the branch. Regression test locks the hist.dtypes dispatch and forbids hardcoded int64 casts. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
cipher813
added a commit
that referenced
this pull request
Apr 21, 2026
Adds builders/promote_ohlcv_only_schema.py — scans every symbol in the universe library and rewrites any whose stored schema lacks feature columns to the full OHLCV + FEATURE schema. Context: PR #76 (short-history first-class) persisted some symbols as OHLCV-only. PR #78 (per-feature graceful degrade) now writes full schema on every daily_append pass. ArcticDB update() enforces schema match, so the transitional OHLCV-only symbols fail today's daily_append with n_err and their row never lands. 2026-04-21 post-#78 run reported n_err=2. The migration reads each candidate's OHLCV history, runs compute_features (partial-feature semantics per PR #78), and calls lib.write() to replace the symbol. write() is authoritative for schema; update() is incremental and cannot widen columns. One-shot, idempotent — symbols already at full schema are skipped. Supports --dry-run for plan review and --ticker X for targeted retries. Regression tests lock: - write() (not update()) for the rewrite - exhaustive FEATURE-column detection (no heuristic subsets) - explicit error reason on empty compute_features (no silent skip) - --dry-run guards the write() call - partial-features structured log matches daily_append convention Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 tasks
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
daily_append.pystops silently skipping short-history tickers (new listings / IPOs / spinoffs). Below theMIN_ROWS_FOR_FEATURES=265warmup threshold, we now write an OHLCV-only row with NaN for every feature column — and log loudly (short-history ticker=X rows=N).n_partialcounter distinguishes short-history writes from legit skips (dry run / NaN close) and read errors.Why
Root cause of the 2026-04-21 EOD failure. Held short-history tickers (SNDK after the 2026 WDC flash-memory spinoff, ~44 rows) had no ArcticDB row for today because
daily_appendsilentlyn_skip++'d and wrote nothing. EOD reconcile then hard-failed looking up the authoritative close.New listings are a normal, recurring market event — S&P 500+400 sees 20-40 constituent changes/year, every spinoff creates one. Treating them as an edge case guarantees we re-hit this bug on every universe rotation. Violates three standing preferences:
What is NOT in this PR (follow-ups)
Test plan
🤖 Generated with Claude Code