Skip to content

CNBC and insider trading readers return the day before the upload date for an empty AdviceDate/FileDate #23

Open

Description

Problem

When the downloaders omit the date column because it equals the upload date, the readers' fallback returns the upload date minus one day instead of the upload date.

  • DataProcessing/QuiverCNBCDataDownloader.cs:114-118 leaves AdviceDate empty when the advice date equals the upload date, with the comment "Reader falls back to uploadedDate in that case".
  • DataProcessing/QuiverInsiderTradingDataDownloader.cs:119-123 leaves FileDate empty when its calendar day equals the upload date, with the comment "Reader falls back to uploadedDate, preserving the day".
  • The readers return uploadedDate.AddDays(-1) for an empty column: QuiverCNBC.cs, QuiverCNBCsUniverse.cs, QuiverInsiderTrading.cs, QuiverInsiderTradingUniverse.cs (after Keep explicit AdviceDate values in CNBC readers #22 and Keep explicit FileDate timestamps in insider trading readers #19; on master the offset is applied to the whole expression, with the same result for an empty column).

Reproduction

A CNBC row uploaded on 2026-05-08 with advice date 2026-05-08 is written as:

20260508,,0,Example Person,catalyst
Expected AdviceDate: 2026-05-08
Actual AdviceDate:   2026-05-07

The insider trading readers do the same for a filing on its upload day: FileDate comes back one day before it.

Required outcome

An empty AdviceDate / FileDate column reads back as the upload date the downloader omitted it for, in both readers of each dataset. Time / EndTime and explicit values stay as they are. Tests Reader_EmptyAdviceDateFallsBackToUploadedMinusOne, UniverseReader_EmptyAdviceDateFallsBackToDateMinusOne and the insider trading empty-FileDate tests assert the current shifted value and would change.

Suggestion: drop the .AddDays(-1) from the fallback branch once #22 and #19 are merged.

Priority is P2: the impact is a one-day error in a metadata field on rows whose date equals the upload day; evidence of algorithms relying on these fields would raise it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions