From 2eb75fffd831eb7ffaf576a41f95607f88d7b783 Mon Sep 17 00:00:00 2001 From: jsonbailey Date: Mon, 29 Sep 2025 21:54:36 +0000 Subject: [PATCH 1/5] fix: Add missing config values to copy operation --- ldclient/config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ldclient/config.py b/ldclient/config.py index 32b28dfc..15286e94 100644 --- a/ldclient/config.py +++ b/ldclient/config.py @@ -333,6 +333,12 @@ def copy_with_new_sdk_key(self, new_sdk_key: str) -> 'Config': wrapper_version=self.__wrapper_version, http=self.__http, big_segments=self.__big_segments, + application = self.__application, + hooks = self.__hooks, + plugins = self.__plugins, + enable_event_compression = self.__enable_event_compression, + omit_anonymous_contexts = self.__omit_anonymous_contexts, + payload_filter_key = self.__payload_filter_key, ) # for internal use only - probably should be part of the client logic From 296d45f4b455b0fda6b4229ecfad79dc01d341b9 Mon Sep 17 00:00:00 2001 From: jsonbailey Date: Mon, 29 Sep 2025 22:01:40 +0000 Subject: [PATCH 2/5] fix lint issue --- ldclient/config.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ldclient/config.py b/ldclient/config.py index 15286e94..55dc54c8 100644 --- a/ldclient/config.py +++ b/ldclient/config.py @@ -333,12 +333,12 @@ def copy_with_new_sdk_key(self, new_sdk_key: str) -> 'Config': wrapper_version=self.__wrapper_version, http=self.__http, big_segments=self.__big_segments, - application = self.__application, - hooks = self.__hooks, - plugins = self.__plugins, - enable_event_compression = self.__enable_event_compression, - omit_anonymous_contexts = self.__omit_anonymous_contexts, - payload_filter_key = self.__payload_filter_key, + application=self.__application, + hooks=self.__hooks, + plugins=self.__plugins, + enable_event_compression=self.__enable_event_compression, + omit_anonymous_contexts=self.__omit_anonymous_contexts, + payload_filter_key=self.__payload_filter_key, ) # for internal use only - probably should be part of the client logic From f31b59d78df59c9a6d5eb563a41428f5f38fe6a9 Mon Sep 17 00:00:00 2001 From: jsonbailey Date: Wed, 4 Feb 2026 19:28:36 +0000 Subject: [PATCH 3/5] add deprecation instead of updating function --- ldclient/config.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ldclient/config.py b/ldclient/config.py index 55dc54c8..ab16ccf7 100644 --- a/ldclient/config.py +++ b/ldclient/config.py @@ -6,6 +6,7 @@ from threading import Event from typing import Callable, List, Optional, Set +import warnings from ldclient.feature_store import InMemoryFeatureStore from ldclient.hook import Hook @@ -303,8 +304,11 @@ def __init__( def copy_with_new_sdk_key(self, new_sdk_key: str) -> 'Config': """Returns a new ``Config`` instance that is the same as this one, except for having a different SDK key. + DEPRECATED: This method is deprecated and will be removed in a future version. + :param new_sdk_key: the new SDK key """ + warnings.warn("copy_with_new_sdk_key is deprecated and will be removed in a future version", DeprecationWarning) return Config( sdk_key=new_sdk_key, base_uri=self.__base_uri, @@ -333,12 +337,6 @@ def copy_with_new_sdk_key(self, new_sdk_key: str) -> 'Config': wrapper_version=self.__wrapper_version, http=self.__http, big_segments=self.__big_segments, - application=self.__application, - hooks=self.__hooks, - plugins=self.__plugins, - enable_event_compression=self.__enable_event_compression, - omit_anonymous_contexts=self.__omit_anonymous_contexts, - payload_filter_key=self.__payload_filter_key, ) # for internal use only - probably should be part of the client logic From 9016e655e72210f41bc4474d8a4082049ab6c904 Mon Sep 17 00:00:00 2001 From: jsonbailey Date: Wed, 4 Feb 2026 19:33:09 +0000 Subject: [PATCH 4/5] fix lint issue --- ldclient/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldclient/config.py b/ldclient/config.py index b52c1ab1..3b1a07f6 100644 --- a/ldclient/config.py +++ b/ldclient/config.py @@ -4,10 +4,10 @@ Note that the same class can also be imported from the ``ldclient.client`` submodule. """ +import warnings from dataclasses import dataclass from threading import Event from typing import Callable, List, Optional, Protocol, Set, TypeVar -import warnings from ldclient.feature_store import InMemoryFeatureStore from ldclient.hook import Hook From 09cec6d3fc26afa50e5d80f9a2574efa802577d7 Mon Sep 17 00:00:00 2001 From: jsonbailey Date: Wed, 4 Feb 2026 19:37:09 +0000 Subject: [PATCH 5/5] show where the developer is calling the deprecated function from --- ldclient/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldclient/config.py b/ldclient/config.py index 3b1a07f6..5fed0665 100644 --- a/ldclient/config.py +++ b/ldclient/config.py @@ -362,7 +362,7 @@ def copy_with_new_sdk_key(self, new_sdk_key: str) -> 'Config': :param new_sdk_key: the new SDK key """ - warnings.warn("copy_with_new_sdk_key is deprecated and will be removed in a future version", DeprecationWarning) + warnings.warn("copy_with_new_sdk_key is deprecated and will be removed in a future version", DeprecationWarning, stacklevel=2) return Config( sdk_key=new_sdk_key, base_uri=self.__base_uri,