From 42c82b87bcf127cbaf0e01b9adf55cfd367e1f53 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 5 Nov 2026 23:47:03 +0000 Subject: [PATCH] fix: Log a non-string kind attribute as an error Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> --- ld_openfeature/impl/context_converter.py | 2 +- tests/test_provider.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ld_openfeature/impl/context_converter.py b/ld_openfeature/impl/context_converter.py index 341c0c6..f359885 100644 --- a/ld_openfeature/impl/context_converter.py +++ b/ld_openfeature/impl/context_converter.py @@ -52,7 +52,7 @@ def to_ld_context(self, context: EvaluationContext) -> Context: return self.__build_multi_context(context) if kind is not None and not isinstance(kind, str): - logger.warning("'kind' was set to a non-string value; defaulting to user") + logger.error("'kind' was set to a non-string value; defaulting to user") kind = 'user' targeting_key = context.targeting_key diff --git a/tests/test_provider.py b/tests/test_provider.py index 0fe2e35..928112b 100644 --- a/tests/test_provider.py +++ b/tests/test_provider.py @@ -237,6 +237,7 @@ def test_logger_changes_should_cascade_to_evaluation_converter(provider: LaunchD assert len(caplog.records) == 1 assert caplog.records[0].message == "'kind' was set to a non-string value; defaulting to user" + assert caplog.records[0].levelname == 'ERROR' def test_track_without_context_does_not_send_an_event(provider: LaunchDarklyProvider):