From 1270d21b8ae043a63af2d9dc57092bc94e4c23da Mon Sep 17 00:00:00 2001 From: rajatsmukherjee Date: Thu, 17 Aug 2023 13:36:13 +0530 Subject: [PATCH 1/2] added nonkeyword deprecation --- pandas/core/generic.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 7624c8f7c7930..88fa32ca5b20b 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -3017,6 +3017,9 @@ def to_sql( ) @final + @deprecate_nonkeyword_arguments( + version=None, allowed_args=["self", "path"], name="to_pickle" + ) @doc( storage_options=_shared_docs["storage_options"], compression_options=_shared_docs["compression_options"] % "path", From e5a2918f880c567f1e57e596a7aa04374cd6e07e Mon Sep 17 00:00:00 2001 From: rajatsmukherjee Date: Thu, 17 Aug 2023 14:02:09 +0530 Subject: [PATCH 2/2] added whatsnew --- doc/source/whatsnew/v2.2.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v2.2.0.rst b/doc/source/whatsnew/v2.2.0.rst index c35473b852eb9..9295ad6cb9aa6 100644 --- a/doc/source/whatsnew/v2.2.0.rst +++ b/doc/source/whatsnew/v2.2.0.rst @@ -92,7 +92,7 @@ Other API changes Deprecations ~~~~~~~~~~~~ -- +- Deprecated allowing non-keyword arguments in :meth:`DataFrame.to_pickle` except ``path``. (:issue:`54229`) - .. ---------------------------------------------------------------------------