Skip to content

Fix near-term release dates missing from the macro calendar (weekly limit)#369

Merged
cipher813 merged 1 commit into
mainfrom
fix/release-calendar-weekly-limit
Jun 4, 2026
Merged

Fix near-term release dates missing from the macro calendar (weekly limit)#369
cipher813 merged 1 commit into
mainfrom
fix/release-calendar-weekly-limit

Conversation

@cipher813
Copy link
Copy Markdown
Owner

The bug

The seeded macro_release_calendar.parquet was missing ~7 weeks of near-term Initial Claims (ICSA) dates — it started at 7/23 instead of 6/5. Monthly series (CPI/unemployment/sentiment) were fine.

Cause

_fred_release_dates queried FRED with sort_order=desc + limit=24. Desc returns the furthest-future scheduled dates first, so for a weekly series (which has ~52 future scheduled dates) the top-24 are all far-future and the nearest ones fall off the bottom of the limit.

Fix

Bump the limit to 130 — comfortably covers a year-plus of any cadence (weekly ≈ 52/yr) so the desc window always reaches today; the caller still trims to the 180-day horizon. Added a regression test pinning limit >= 120 + the include_release_dates_with_no_data / sort_order params (the existing tests mock _fred_release_dates wholesale, so they can't catch the query params).

Verification

  • 17 macro/registry tests pass.
  • Re-seeded the live artifact: ICSA now 26 weekly dates from 2026-06-04; 49 events total (was 42 with the gap). Earliest events: 6/4 (claims), 6/5 (jobs), 6/10 (CPI).

Follows the merged #368.

🤖 Generated with Claude Code

build_release_calendar fetched release dates with sort_order=desc + limit=24.
desc returns the FURTHEST-future dates first, so for a weekly series (ICSA) with
many scheduled future dates the NEAREST ones fell off the bottom — the seeded
artifact was missing ~7 weeks of near-term initial-claims dates (started 7/23
instead of 6/5). Monthly series were unaffected. Bump the limit to 130 (covers
a year-plus of any cadence); the caller still trims to the 180d horizon.

Adds a regression test pinning the limit floor + future-dates flag, since the
existing tests mock _fred_release_dates wholesale and can't catch the param.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cipher813 cipher813 merged commit 956e7c6 into main Jun 4, 2026
1 check passed
@cipher813 cipher813 deleted the fix/release-calendar-weekly-limit branch June 4, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant