From 76757f709ca34f7ea9f00492ccbef5fa5b9c9651 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Wed, 10 Dec 2025 15:25:07 +0100 Subject: [PATCH] DEPR: reword deprecation message for mode.copy_on_write option --- pandas/core/config_init.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandas/core/config_init.py b/pandas/core/config_init.py index 7d9cda92de874..bdd1db1aeeb91 100644 --- a/pandas/core/config_init.py +++ b/pandas/core/config_init.py @@ -423,7 +423,7 @@ def is_terminal() -> bool: # to False. This environment variable can be set for testing. "warn" if os.environ.get("PANDAS_COPY_ON_WRITE", "0") == "warn" - else os.environ.get("PANDAS_COPY_ON_WRITE", "0") == "1", + else os.environ.get("PANDAS_COPY_ON_WRITE", "1") == "1", copy_on_write_doc, validator=is_one_of_factory([True, False, "warn"]), ) @@ -908,7 +908,8 @@ def register_converter_cb(key: str) -> None: "mode.copy_on_write", Pandas4Warning, msg=( - "Copy-on-Write can no longer be disabled, setting to False has no impact. " - "This option will be removed in pandas 4.0." + "The 'mode.copy_on_write' option is deprecated. Copy-on-Write can no longer " + "be disabled (it is always enabled with pandas >= 3.0), and setting the option " + "has no impact. This option will be removed in pandas 4.0." ), )