Skip to content

Commit 869bbf4

Browse files
committed
fix: use asdict()
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
1 parent 3b6ddaa commit 869bbf4

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
@@ -29,10 +30,7 @@ def _build_args(self, hook_context: HookContext, stage: str) -> dict:
2930
}
3031
if self.include_evaluation_context:
3132
args["evaluation_context"] = json.dumps(
32-
{
33-
"targeting_key": hook_context.evaluation_context.targeting_key,
34-
"attributes": hook_context.evaluation_context.attributes,
35-
},
33+
asdict(hook_context.evaluation_context),
3634
default=str,
3735
)
3836
return args

0 commit comments

Comments
 (0)