Skip to content

feat: backfill external signals - #46

Merged
selvarajuv merged 4 commits into
mainfrom
37-backfill-external-signals
Oct 13, 2026
Merged

selvarajuv merged 4 commits into
mainfrom
37-backfill-external-signals

Conversation

@narang-an

@narang-an narang-an commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR adds scripts to backfill weather and events data.

The flights API requires a subscription to be used we may have to look into another solution for getting both historical and future data for it, we could maybe use data from the free apis (opensky and cso) to check if it's worth getting flight data first before we decide to pay. The events api also requires a subscription so we backfilled as much as we could on the free plan.

Type of change

  • feat — new feature
  • fix — bug fix
  • docs — documentation only
  • refactor — code change that neither fixes a bug nor adds a feature
  • perf — performance improvement
  • test — adding or updating tests
  • chore / build / ci — tooling, deps, or pipeline changes

Changes

  • made scripts/backfill
  • created services/backfill

Database migrations

  • No schema changes
  • Includes an Alembic migration (just migrate-create "...")
  • Migration runs cleanly (just migrate) and rolls back (just migrate-down)

Checklist

  • Commits follow Conventional Commits
  • Lint passes (just lint) and code is formatted (just format)
  • Pre-commit hooks run clean (just hooks installed)
  • Updated docs / README / .env.example where relevant
  • Tested locally (just dev) and verified the API at http://localhost:8000/docs

How to test

Notes for reviewers

@narang-an narang-an changed the title 37 backfill external signals feat: #37 backfill external signals Oct 13, 2026
@narang-an narang-an changed the title feat: #37 backfill external signals feat: backfill external signals Oct 13, 2026
Maria Samos Rivas and others added 4 commits October 13, 2026 14:18
Long backfills sent every row in one statement, which fails past 32,767
bind parameters. Rows are now written in batches sized to stay under it.

Co-authored-by: Vichu Selvaraju <vichuselvaraju@gmail.com>
AeroDataBox requests are paced, retry 429/5xx/network errors with backoff,
and raise RateLimitedError once the quota is spent; delayed flights from
the previous day are skipped. Weather archive requests go a year at a
time so a failure only redoes that year.

Co-authored-by: Vichu Selvaraju <vichuselvaraju@gmail.com>
Services fetch and upsert without committing; events yield after each
month and flights after each day, so the scripts in scripts/backfill/
commit as they go and an interrupted run resumes where it stopped. The
default window is a hotel's first and last stay_date in daily_performance.
ingest/run.py's market helpers and migrate() are public for the scripts.

Co-authored-by: narang-an <narang.an@northeastern.edu>
Co-authored-by: Vichu Selvaraju <vichuselvaraju@gmail.com>
Co-authored-by: Vichu Selvaraju <vichuselvaraju@gmail.com>
@selvarajuv
selvarajuv force-pushed the 37-backfill-external-signals branch from db7332f to cbcf66c Compare October 13, 2026 18:57
@selvarajuv
selvarajuv merged commit 533aa3d into main Oct 13, 2026
4 checks passed
@Jrodrigo06
Jrodrigo06 deleted the 37-backfill-external-signals branch October 15, 2026 13:58
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.

2 participants