Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove EvaluationOptions from method signatures #14

Merged
merged 3 commits into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions open_feature/open_feature_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,119 +43,103 @@ def get_boolean_value(
key: str,
default_value: bool,
evaluation_context: EvaluationContext = None,
flag_evaluation_options: typing.Any = None,
beeme1mr marked this conversation as resolved.
Show resolved Hide resolved
) -> bool:
return self.evaluate_flag_details(
FlagType.BOOLEAN,
key,
default_value,
evaluation_context,
flag_evaluation_options,
).value

def get_boolean_details(
self,
key: str,
default_value: bool,
evaluation_context: EvaluationContext = None,
flag_evaluation_options: typing.Any = None,
) -> FlagEvaluationDetails:
return self.evaluate_flag_details(
FlagType.BOOLEAN,
key,
default_value,
evaluation_context,
flag_evaluation_options,
)

def get_string_value(
self,
key: str,
default_value: str,
evaluation_context: EvaluationContext = None,
flag_evaluation_options: typing.Any = None,
) -> str:
return self.evaluate_flag_details(
FlagType.STRING,
key,
default_value,
evaluation_context,
flag_evaluation_options,
).value

def get_string_details(
self,
key: str,
default_value: str,
evaluation_context: EvaluationContext = None,
flag_evaluation_options: typing.Any = None,
) -> FlagEvaluationDetails:
return self.evaluate_flag_details(
FlagType.STRING,
key,
default_value,
evaluation_context,
flag_evaluation_options,
)

def get_number_value(
self,
key: str,
default_value: Number,
evaluation_context: EvaluationContext = None,
flag_evaluation_options: typing.Any = None,
) -> Number:
return self.evaluate_flag_details(
FlagType.NUMBER,
key,
default_value,
evaluation_context,
flag_evaluation_options,
).value

def get_number_details(
self,
key: str,
default_value: Number,
evaluation_context: EvaluationContext = None,
flag_evaluation_options: typing.Any = None,
) -> FlagEvaluationDetails:
return self.evaluate_flag_details(
FlagType.NUMBER,
key,
default_value,
evaluation_context,
flag_evaluation_options,
)

def get_object_value(
self,
key: str,
default_value: dict,
evaluation_context: EvaluationContext = None,
flag_evaluation_options: typing.Any = None,
) -> dict:
return self.evaluate_flag_details(
FlagType.OBJECT,
key,
default_value,
evaluation_context,
flag_evaluation_options,
).value

def get_object_details(
self,
key: str,
default_value: dict,
evaluation_context: EvaluationContext = None,
flag_evaluation_options: typing.Any = None,
) -> FlagEvaluationDetails:
return self.evaluate_flag_details(
FlagType.OBJECT,
key,
default_value,
evaluation_context,
flag_evaluation_options,
)

def evaluate_flag_details(
Expand All @@ -164,7 +148,6 @@ def evaluate_flag_details(
key: str,
default_value: typing.Any,
evaluation_context: EvaluationContext = None,
flag_evaluation_options: typing.Any = None,
) -> FlagEvaluationDetails:
"""
Evaluate the flag requested by the user from the clients provider.
Expand Down Expand Up @@ -210,7 +193,6 @@ def evaluate_flag_details(
key,
default_value,
merged_context,
flag_evaluation_options,
)

after_hooks(type, hook_context, flag_evaluation, merged_hooks, None)
Expand All @@ -237,7 +219,6 @@ def create_provider_evaluation(
key: str,
default_value: typing.Any,
evaluation_context: EvaluationContext = None,
flag_evaluation_options: typing.Any = None,
) -> FlagEvaluationDetails:
"""
Encapsulated method to create a FlagEvaluationDetail from a specific provider.
Expand All @@ -254,7 +235,6 @@ def create_provider_evaluation(
key,
default_value,
evaluation_context,
flag_evaluation_options,
)

if not self.provider:
Expand Down
5 changes: 0 additions & 5 deletions open_feature/provider/no_op_provider.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import typing
from numbers import Number

from open_feature.evaluation_context.evaluation_context import EvaluationContext
Expand All @@ -18,7 +17,6 @@ def get_boolean_details(
key: str,
default_value: bool,
evaluation_context: EvaluationContext = None,
flag_evaluation_options: typing.Any = None,
):
return FlagEvaluationDetails(
key=key,
Expand All @@ -32,7 +30,6 @@ def get_string_details(
key: str,
default_value: str,
evaluation_context: EvaluationContext = None,
flag_evaluation_options: typing.Any = None,
):
return FlagEvaluationDetails(
key=key,
Expand All @@ -46,7 +43,6 @@ def get_number_details(
key: str,
default_value: Number,
evaluation_context: EvaluationContext = None,
flag_evaluation_options: typing.Any = None,
):
return FlagEvaluationDetails(
key=key,
Expand All @@ -60,7 +56,6 @@ def get_object_details(
key: str,
default_value: dict,
evaluation_context: EvaluationContext = None,
flag_evaluation_options: typing.Any = None,
):
return FlagEvaluationDetails(
key=key,
Expand Down
5 changes: 0 additions & 5 deletions open_feature/provider/provider.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import typing
from abc import abstractmethod
from numbers import Number

Expand All @@ -16,7 +15,6 @@ def get_boolean_details(
key: str,
default_value: bool,
evaluation_context: EvaluationContext = EvaluationContext(),
flag_evaluation_options: typing.Any = None,
):
pass

Expand All @@ -26,7 +24,6 @@ def get_string_details(
key: str,
default_value: str,
evaluation_context: EvaluationContext = EvaluationContext(),
flag_evaluation_options: typing.Any = None,
):
pass

Expand All @@ -36,7 +33,6 @@ def get_number_details(
key: str,
default_value: Number,
evaluation_context: EvaluationContext = EvaluationContext(),
flag_evaluation_options: typing.Any = None,
):
pass

Expand All @@ -46,6 +42,5 @@ def get_object_details(
key: str,
default_value: dict,
evaluation_context: EvaluationContext = EvaluationContext(),
flag_evaluation_options: typing.Any = None,
):
pass