web/pandas/pdeps/0017-backwards-compatibility-and-deprecation-policy.md
This PDEP defines pandas' backwards compatibility and deprecation policy.
The main additions to pandas' current version policy are:
Having a clear backwards compatibility and deprecation policy is crucial to having a healthy ecosystem. We want to ensure users can rely on pandas being stable while still allowing the library to evolve.
This policy will ensure that users have enough time to deal with deprecations while also minimizing disruptions on downstream packages' users.
This PDEP covers pandas' approach to backwards compatibility and the deprecation and removal process.
pandas uses a loose variant of semantic versioning.
A pandas release number is written in the format of MAJOR.MINOR.PATCH.
This policy applies to the public API. Anything not part of the public API or is marked as "Experimental" may be changed or removed at anytime.
Some bug fixes may require breaking backwards compatibility. In these cases, a deprecation cycle is not necessary. However, bug fixes which have a large impact on users might be treated as a breaking change. Whether or not a change is a bug fix or an API breaking change is a judgement call.
Deprecation provides a way to warn developers and give them time to adapt their code to the new functionality before the old behavior is eventually removed.
A deprecation's warning message should:
Additionally, when one introduces a deprecation, they should:
.. deprecated:: directive.Starting in pandas 3.0, pandas will provide version-specific warnings. For example, Pandas4Warnings for all deprecation warnings that will be enforced in pandas 4.0. In addition to these, pandas exposes four additional classes to give users more control over pandas deprecation warnings.
pandas.errors.PandasChangeWarning: Base class of all pandas deprecation warnings.pandas.errors.PandasPendingDeprecationWarning: Base class of all warnings which emit a PendingDeprecationWarning, independent of the version they will be enforced.pandas.errors.PandasDeprecationWarning: Base class of all warnings which emit a DeprecationWarning, independent of the version they will be enforced.pandas.errors.PandasFutureWarning: Base class of all warnings which emit a FutureWarning, independent of the version they will be enforced.When one enforces a deprecation, they should:
.. deprecated:: directive in the documentation with a .. versionchanged:: directive.