Skip to content

pandas 3.0 (anaconda 2026.06) breaks hansen_singleton lectures via pandas-datareader #924

Description

@mmcky

Summary

A full forced execution of every lecture under anaconda 2026.06 (which upgrades pandas 2.3.3 → 3.0.3, proposed in #923) fails on hansen_singleton_1982 and hansen_singleton_1983. Both break at import of pandas_datareader, which is incompatible with pandas 3.0. These lectures execute cleanly on main (pandas 2.3.3), so this is a genuine regression introduced by the anaconda 2026.06 upgrade. Blocks #923.

Why normal CI did not catch it

The project builds with execute_notebooks: "cache" and PR CI restores the build cache from main. jupyter-cache keys on notebook code, not on the environment, so a dependency-only PR like #923 reuses cached outputs and never re-executes the notebooks under the new stack — the preview check only proves the conda environment solves. This failure was found by temporarily forcing a full re-execution under 2026.06 (run 27897336159).

Error

File .../site-packages/pandas_datareader/data.py:273
--> 273 @deprecate_kwarg("access_key", "api_key")
    274 def DataReader(
TypeError: deprecate_kwarg() missing 1 required positional argument: 'new_arg_name'

Cause

pandas_datareader is installed at runtime via !pip install pandas-datareader (currently 0.10.0 — last released 2021, effectively unmaintained). It relies on the private pandas API pandas.util._decorators.deprecate_kwarg, whose signature changed in pandas 3.0, so the decorator at pandas_datareader/data.py:273 raises immediately on import. There is no pandas-3.0-compatible pandas-datareader release to pin to.

Affected code

File Lines Code
lectures/hansen_singleton_1982.md 59, 70, 1037, 1053 !pip install pandas-datareaderfrom pandas_datareader import data as webweb.DataReader(...) (FRED + Fama-French)
lectures/hansen_singleton_1983.md 83, 1476, 1491 same pattern

Suggested fix

Drop pandas_datareader and fetch the series directly:

  • FREDpandas.read_csv from the FRED CSV download endpoint, or the fredapi package.
  • Fama-French — download the zip from Ken French's data library and parse it.

After migrating, re-run a full forced execution under anaconda 2026.06 to confirm.

Verification

  • Fails under anaconda 2026.06 (pandas 3.0.3): run 27897336159 (forced full execution).
  • Passes under anaconda 2025.12 (pandas 2.3.3) on main: the weekly cache.yml full build does not fail on these two lectures.

Also observed — pre-existing, NOT caused by #923 (track separately)

ar1_bayes and ar1_turningpts also fail in the forced run, but for an unrelated reason: az.plot_trace(trace, figsize=(17,6)) is rejected by the rewritten arviz plotting backend (ValueError: Keyword arguments ['figsize'] have been passed as **kwargs but have no active aesthetic mapped to them). They pull an unpinned arviz via !pip install arviz pymc and have been failing on main's weekly cache build for 5+ weeks, independent of the pandas upgrade.

Activity

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

    bugSomething is wrong or broken in a lecture or buildbuild-failureNotebook execution, build, or warnings failuredependenciesDependency or environment update (pip, conda, actions)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions