Repository navigation
Keep explicit AdviceDate values in CNBC readers - #22
Conversation
QuiverCNBC and QuiverCNBCsUniverse subtracted a day from the advice date even when the CSV stored it explicitly. Apply the one-day offset only to the fallback used when the column is empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Approved. The offset now applies only to the empty-column fallback in both CNBC readers, matching what the downloader writes (processDate unshifted) and #20's required outcome. The updated Reader_ParsesCompactFormat and UniverseReader_ParsesCompactFormat fail against master's readers (Expected 2026-05-07, But was 2026-05-06) and pass with this change; the new universe fallback test covers the untested branch.
On the description's question: the fallback returning the upload date minus one day contradicts the downloaders' own comments (both CNBC and insider trading), so I opened #23 for it rather than holding this change.
Risk set to risk:low: a two-line bug fix to a metadata field, easy to revert, with regression tests, green CI and an end-to-end run; Time/EndTime and the fallback are unchanged.
There was a problem hiding this comment.
Approved. Independently verified the full Release suite passes (90/90), while the two updated explicit-date tests fail against the base readers with the expected one-day discrepancy.
Also tested end to end: both QuiverCNBCs and QuiverCNBCsUniverse return the stored 20260602 advice date as 2026-06-02 rather than 2026-06-01, with Time and EndTime unchanged. The fix meets #20 without changing the empty-column fallback.
The sibling QuiverInsiderTrading and QuiverInsiderTradingUniverse explicit-FileDate bug is handled separately in #19; no additional implementation needs this CNBC correction.
Closes #20
What changed
QuiverCNBC.ReaderandQuiverCNBCsUniverse.Readerapplied.AddDays(-1)to the whole parse-or-fallback expression forAdviceDate, so an advice date stored in the CSV came back one day early. The downloader writes that column unshifted. The offset now applies only to the fallback used when the column is empty, as #19 does for the insider trading readers'FileDate.AdviceDate: returned as stored (20260507→ 2026-05-07, was 2026-05-06).AdviceDate: unchanged, still the read date minus one day.Time/EndTime: unchanged.Tests
Reader_ParsesCompactFormatandUniverseReader_ParsesCompactFormatnow expect the stored advice date.UniverseReader_EmptyAdviceDateFallsBackToDateMinusOnecovers the universe reader's empty-column fallback, which nothing tested before (the per-security reader already hadReader_EmptyAdviceDateFallsBackToUploadedMinusOne).Full suite, as CI runs it:
Tested end to end with a backtest on AAL from 2026-05-28 to 2026-06-05 that subscribes to
QuiverCNBCsand theQuiverCNBCsUniverse, reading the dataset's real files, where the 2026-06-03 upload stores advice date20260602:AdviceDate=2026-06-02.master: the universe reportsAdviceDate=2026-06-01.Question
The downloader leaves the advice date column empty when the advice date equals the upload date (
QuiverCNBCDataDownloader.Run,uploadDate == processDate). The fallback returns the upload date minus one day, so those rows come back a day before their advice date. The issue asks to keep the fallback as it is, so this change leaves it alone. Should the fallback return the upload date itself? That would be a separate change.