Skip to content

Commit 42c82b8

Browse files
fix: Log a non-string kind attribute as an error
Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
1 parent a6f8092 commit 42c82b8

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

‎ld_openfeature/impl/context_converter.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def to_ld_context(self, context: EvaluationContext) -> Context:
5252
return self.__build_multi_context(context)
5353

5454
if kind is not None and not isinstance(kind, str):
55-
logger.warning("'kind' was set to a non-string value; defaulting to user")
55+
logger.error("'kind' was set to a non-string value; defaulting to user")
5656
kind = 'user'
5757

5858
targeting_key = context.targeting_key

‎tests/test_provider.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ def test_logger_changes_should_cascade_to_evaluation_converter(provider: LaunchD
237237

238238
assert len(caplog.records) == 1
239239
assert caplog.records[0].message == "'kind' was set to a non-string value; defaulting to user"
240+
assert caplog.records[0].levelname == 'ERROR'
240241

241242

242243
def test_track_without_context_does_not_send_an_event(provider: LaunchDarklyProvider):

0 commit comments

Comments
 (0)