Skip to content

Commit

Permalink
fix: Allow string values for FlagEvaluationDetails.reason and `Flag…
Browse files Browse the repository at this point in the history
…ResolutionDetails.reason` (#264)

* fix: Allow string values for `FlagEvaluationDetails.reason` and ``FlagResolutionDetails.reason`

Signed-off-by: Matthew Keeler <mkeeler@launchdarkly.com>

* Remove useless test

Signed-off-by: Matthew Keeler <mkeeler@launchdarkly.com>

---------

Signed-off-by: Matthew Keeler <mkeeler@launchdarkly.com>
  • Loading branch information
keelerm84 authored Jan 29, 2024
1 parent f1b0839 commit 5ef6ca1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openfeature/flag_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class FlagEvaluationDetails(typing.Generic[T_co]):
value: T_co
variant: typing.Optional[str] = None
flag_metadata: FlagMetadata = field(default_factory=dict)
reason: typing.Optional[Reason] = None
reason: typing.Optional[typing.Union[str, Reason]] = None
error_code: typing.Optional[ErrorCode] = None
error_message: typing.Optional[str] = None

Expand All @@ -59,6 +59,6 @@ class FlagResolutionDetails(typing.Generic[U_co]):
value: U_co
error_code: typing.Optional[ErrorCode] = None
error_message: typing.Optional[str] = None
reason: typing.Optional[Reason] = None
reason: typing.Optional[typing.Union[str, Reason]] = None
variant: typing.Optional[str] = None
flag_metadata: FlagMetadata = field(default_factory=dict)

0 comments on commit 5ef6ca1

Please sign in to comment.