From 689d26842fabdaebe38c56b5052a520d6b6b46f2 Mon Sep 17 00:00:00 2001 From: Karthik Tadepalli Date: Fri, 24 Apr 2026 16:10:31 -0700 Subject: [PATCH] Forward-compat with pandas 3.x; document th-1-0 -> th-1-1 ordering Replace pd.Series._append with pd.concat in agent_regression: the private _append was removed in pandas 3.0 (uv.lock currently pins 2.3.3, where it still exists, so the locked pipeline isn't broken). Also add a README note that time-horizon-1-0 must be reproduced before time-horizon-1-1, since the latter consumes the former's wrangled outputs (bootstrap CSVs, logistic fits, benchmark metrics). Co-Authored-By: Claude Opus 4.7 (1M context) --- README.md | 2 ++ src/horizon/wrangle/logistic.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 62265ad..a042fc8 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,8 @@ cd reports/time-horizon-1-0 dvc repro # Run the time-horizon-1-1 report +# NOTE: time-horizon-1-0 must be reproduced first, as time-horizon-1-1 +# depends on its outputs (e.g. data/wrangled/logistic_fits/headline.csv). cd reports/time-horizon-1-1 dvc repro ``` diff --git a/src/horizon/wrangle/logistic.py b/src/horizon/wrangle/logistic.py index ef0cd94..55aca0a 100644 --- a/src/horizon/wrangle/logistic.py +++ b/src/horizon/wrangle/logistic.py @@ -117,7 +117,7 @@ def agent_regression( values.extend([0, 0, 0]) # p{n}, p{n}q10, p{n}q90 result = pd.Series(values, index=indices) # type: ignore[reportCallIssue] if include_empirical_rates: - result = result._append(empirical_rates) + result = pd.concat([result, empirical_rates]) return result model = logistic_regression( @@ -160,7 +160,7 @@ def agent_regression( result = pd.Series(values, index=indices) # type: ignore[reportCallIssue] if include_empirical_rates: - result = result._append(empirical_rates) + result = pd.concat([result, empirical_rates]) return result