55from dataclasses import dataclass , field
66
77from openfeature ._backports .strenum import StrEnum
8- from openfeature .evaluation_context import EvaluationContext
8+ from openfeature .evaluation_context import EvaluationContext , EvaluationContextAttribute
99from openfeature .exception import ErrorCode
1010from openfeature .flag_evaluation import FlagResolutionDetails , Reason
1111from openfeature .provider import AbstractProvider , Metadata
@@ -26,7 +26,7 @@ class InMemoryMetadata(Metadata):
2626class InMemoryTrackingEvent ():
2727 value : float | None = None
2828 details : dict [str , typing .Any ] = field (default_factory = dict )
29- eval_context_attributes : dict [str , typing . Any ] = field (default_factory = dict )
29+ eval_context_attributes : Mapping [str , EvaluationContextAttribute ] = field (default_factory = dict )
3030
3131
3232
@@ -195,7 +195,7 @@ async def _resolve_async(
195195 def track (self , tracking_event_name : str , evaluation_context : EvaluationContext | None = None , tracking_event_details : TrackingEventDetails | None = None ) -> None :
196196 value = tracking_event_details .value if tracking_event_details is not None else None
197197 details = tracking_event_details .attributes if tracking_event_details is not None else {}
198- eval_context_attributes = evaluation_context .attributes if evaluation_context is not None else None
198+ eval_context_attributes = evaluation_context .attributes if evaluation_context is not None else {}
199199
200200 self ._tracking_events [tracking_event_name ] = InMemoryTrackingEvent (
201201 value = value ,
0 commit comments