Skip to content

Commit 8b3bc3a

Browse files
committed
fix: use asdict()
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
1 parent 5ae437f commit 8b3bc3a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

openfeature/hook/logging_hook.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
import logging
3+
from dataclasses import asdict
34

45
from openfeature.evaluation_context import EvaluationContext
56
from openfeature.exception import ErrorCode, OpenFeatureError
@@ -30,10 +31,7 @@ def _build_args(self, hook_context: HookContext, stage: str) -> dict:
3031
}
3132
if self.include_evaluation_context:
3233
args["evaluation_context"] = json.dumps(
33-
{
34-
"targeting_key": hook_context.evaluation_context.targeting_key,
35-
"attributes": hook_context.evaluation_context.attributes,
36-
},
34+
asdict(hook_context.evaluation_context),
3735
default=str,
3836
)
3937
return args

0 commit comments

Comments
 (0)