You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: web/pandas/pdeps/0017-backwards-compatibility-and-deprecation-policy.md
+5-16Lines changed: 5 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,15 +20,11 @@ This policy will ensure that users have enough time to deal with deprecations wh
20
20
21
21
This PDEP covers pandas' approach to backwards compatibility and the deprecation and removal process.
22
22
23
-
The decision making process for deprecating features is out of scope for this PDEP.
24
-
25
23
## Background
26
24
27
25
pandas uses a loose variant of semantic versioning.
28
26
A pandas release number is written in the format of ``MAJOR.MINOR.PATCH``.
29
27
30
-
For the purposes of this PDEP, the last minor release before a major release will be referred to as the 'final minor version'.
31
-
32
28
## General policy
33
29
34
30
This policy applies to the [public API][1]. Anything not part of the [public API][1] or is marked as "Experimental" may be changed or removed at anytime.
@@ -37,6 +33,7 @@ This policy applies to the [public API][1]. Anything not part of the [public API
37
33
- Breaking changes should go through a deprecation cycle before being implemented.
38
34
- Breaking changes should only occur in major releases.
39
35
- No deprecations should be introduced in patch releases.
36
+
- Deprecated functionality should remain unchanged for at least 6 months before being changed or removed.
40
37
41
38
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.
42
39
@@ -58,26 +55,18 @@ Additionally, when one introduces a deprecation, they should:
58
55
59
56
### Which warning class to use
60
57
61
-
Deprecations should initially use ``DeprecationWarning``, and then be switched to ``FutureWarning`` for broader visibility in the final minor version before the major release they are planned to be removed in.
58
+
Deprecations should initially use ``DeprecationWarning``, and then be switched to ``FutureWarning`` for broader visibility in the last minor release before the major release they are planned to be removed in.
62
59
This implementation detail can be ignored by using the appropriate ``PandasDeprecationWarning`` variable, which will be aliased to the proper warning class based on the pandas version.
63
60
64
-
Not all deprecations have to use ``DeprecationWarning`` but all deprecations should eventually transition to ``FutureWarning``, i.e. deprecations in the final minor version which are planned to be removed in the major release after will immediately use ``FutureWarning``.
65
-
66
-
It is recommended to not introduce large-scale deprecations in the final minor version which are planned to be removed in the major release after, since that will immediately be using a loud ``FutureWarning`` with not much time between deprecation and removal. Instead, a ``DeprecationWarning`` should be used, and the removal should be scheduled for a later major release.
67
-
68
-
### Support window for the final minor version
69
-
70
-
Defining a release policy is not part of this PDEP's scope, but, the final minor version plays a special role in deprecations, since:
71
-
- It is the version where deprecations planned for removal in the next major release get switched from a ``DeprecationWarning`` to a more visible ``FutureWarning``.
72
-
-``FutureWarning`` deprecations released in it will immediately be removed in the next major release.
61
+
Not all deprecations have to use ``DeprecationWarning`` but all deprecations should eventually transition to ``FutureWarning``, i.e. deprecations in the last minor release which are planned to be removed in the major release after will immediately use ``FutureWarning``.
73
62
74
-
And so, this document recommends a minimum of 6 months between the final minor version and the major release after it.
63
+
It is recommended to not introduce large-scale deprecations in the last minor release which are planned to be removed in the major release after, since that will immediately be using a loud ``FutureWarning`` with not much time between deprecation and removal. Instead, a ``DeprecationWarning`` should be used, and the removal should be scheduled for a later major release.
75
64
76
65
### Enforcement of deprecations
77
66
78
67
When one enforces a deprecation, they should:
79
68
- Add an entry in the release notes.
80
-
-Replace the ``.. deprecated::`` directive in the documentation with a ``.. versioncchanged::`` directive.
69
+
-For API changes, replace the ``.. deprecated::`` directive in the documentation with a ``.. versionchanged::`` directive.
0 commit comments