Skip to content

ENH/DOC: Vendor or migrate away from pandas' Appender/Substitution docstring helpers #9748

Closed

Description

@mroeschke

Over in pandas-dev/pandas#63846, we have removed/working on removing all usages of Appender/Substitution over in-lining docstrings. We noticed that statsmodels is still making use of these (private) pandas helpers

pandas will deprecate them instead of fully removing for statsmodels compat, but it would be great if statsmodels could vendor or migrate away from these helpers.

(It would also be helpful if statsmodels also vendors cache_readonly and deprecate_kwarg that's imported in statsmodels/compat/pandas.py)

Activity

  1. drammock commented on Feb 12, 2026

    @drammock

    +1. We're seeing downstream CI failures in MNE-Python due to the Pandas4Warning about statsmodel's use of Substitution

    Details
    ______________________________ test_yule_walker _______________________________
    mne\time_frequency\tests\test_ar.py:22: in test_yule_walker
        from statsmodels.regression.linear_model import yule_walker as sm_yw
    C:\hostedtoolcache\windows\Python\3.13.11\x64\Lib\site-packages\statsmodels\regression\__init__.py:3: in <module>
        from .linear_model import yule_walker
    C:\hostedtoolcache\windows\Python\3.13.11\x64\Lib\site-packages\statsmodels\regression\linear_model.py:46: in <module>
        import statsmodels.base.model as base
    C:\hostedtoolcache\windows\Python\3.13.11\x64\Lib\site-packages\statsmodels\base\model.py:29: in <module>
        from statsmodels.tools.numdiff import approx_fprime
    C:\hostedtoolcache\windows\Python\3.13.11\x64\Lib\site-packages\statsmodels\tools\numdiff.py:358: in <module>
        @Substitution(
    C:\hostedtoolcache\windows\Python\3.13.11\x64\Lib\site-packages\pandas\util\_decorators.py:443: in __init__
        warnings.warn(
    E   pandas.errors.Pandas4Warning: Substitution is deprecated and will be removed in a future version.
    
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions