From c0cd1fb645d612d7bf92b7ff7e600bba3a0e0b5b Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sat, 31 May 2025 20:13:58 -0400 Subject: [PATCH] Fix null handling in bitcoin_m2_chart --- scripts/bitcoin_m2_chart.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/bitcoin_m2_chart.py b/scripts/bitcoin_m2_chart.py index a5bb8c0..d667811 100644 --- a/scripts/bitcoin_m2_chart.py +++ b/scripts/bitcoin_m2_chart.py @@ -161,6 +161,12 @@ def main(argv: list[str] | None = None) -> plt.Figure: raise SystemExit(1) btc, m2 = fetch_series(start_dt, end_dt, args.btc_series, args.m2_series, args.db) + + # ─── Drop any rows where the FRED tables had NULLs in "value" ────────────────── + btc = btc.dropna(subset=["value"]) + m2 = m2.dropna(subset=["value"]) + # ──────────────────────────────────────────────────────────────────────────────── + validate_series(btc, m2, args.btc_series, args.m2_series) fig = plot_bitcoin_m2( btc,