Skip to content

Commit

Permalink
feat: make return value not optional in provider API functions
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Bond <federicobond@gmail.com>
  • Loading branch information
federicobond committed Feb 3, 2024
1 parent caa7f36 commit 8329e89
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions openfeature/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ def set_provider(provider: FeatureProvider) -> None:
provider.initialize(_evaluation_context)


def get_provider() -> typing.Optional[FeatureProvider]:
def get_provider() -> FeatureProvider:
global _provider
return _provider


def get_provider_metadata() -> typing.Optional[Metadata]:
def get_provider_metadata() -> Metadata:
global _provider
return _provider.get_metadata()

Expand Down
5 changes: 0 additions & 5 deletions openfeature/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
error_hooks,
)
from openfeature.provider import FeatureProvider
from openfeature.provider.no_op_provider import NoOpProvider

logger = logging.getLogger("openfeature")

Expand Down Expand Up @@ -374,10 +373,6 @@ def _create_provider_evaluation(
evaluation_context,
)

if not self.provider:
logger.info("No provider configured, using no-op provider.")
self.provider = NoOpProvider()

get_details_callables: typing.Mapping[FlagType, GetDetailCallable] = {
FlagType.BOOLEAN: self.provider.resolve_boolean_details,
FlagType.INTEGER: self.provider.resolve_integer_details,
Expand Down

0 comments on commit 8329e89

Please sign in to comment.