-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Move flag evaluation details to a dataclass (#27)
* fix/flag-error-message: Move flag evaluation details to a dataclass and add error message to the class Signed-off-by: Andrew Helsby <[email protected]> Signed-off-by: Andrew Helsby <[email protected]> * fix/flag-error-message: Rename flag_key in FlagEvaluationDetails to match spec Signed-off-by: Andrew Helsby <[email protected]> Signed-off-by: Andrew Helsby <[email protected]> * fix/flag-error-message: Rename flag_key in provider.py to match spec Signed-off-by: Andrew Helsby <[email protected]> Signed-off-by: Andrew Helsby <[email protected]> * fix/flag-error-message: Rename flag_key in open_feature_client.py Signed-off-by: Andrew Helsby <[email protected]> Signed-off-by: Andrew Helsby <[email protected]> * fix/flag-error-message: Rename flag_key in open_feature_client.py Signed-off-by: Andrew Helsby <[email protected]> Signed-off-by: Andrew Helsby <[email protected]> * fix/flag-error-message: handle error_message doesn't exist exception Signed-off-by: Andrew Helsby <[email protected]> Signed-off-by: Andrew Helsby <[email protected]> Signed-off-by: Andrew Helsby <[email protected]>
- Loading branch information
Showing
5 changed files
with
63 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
import typing | ||
from dataclasses import dataclass | ||
|
||
from open_feature.flag_evaluation.error_code import ErrorCode | ||
from open_feature.flag_evaluation.reason import Reason | ||
|
||
|
||
@dataclass | ||
class FlagEvaluationDetails: | ||
def __init__( | ||
self, | ||
key: str, | ||
value, | ||
reason: Reason, | ||
error_code: ErrorCode = None, | ||
variant=None, | ||
): | ||
self.key = key | ||
self.value = value | ||
self.reason = reason | ||
self.error_code = error_code | ||
self.variant = variant | ||
flag_key: str | ||
value: typing.Any | ||
variant: str = None | ||
reason: Reason = None | ||
error_code: ErrorCode = None | ||
error_message: str = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters