Skip to content

Commit

Permalink
fix: remove hasattr usage
Browse files Browse the repository at this point in the history
Signed-off-by: Cole Bailey <cole.bailey@deliveryhero.com>
  • Loading branch information
colebaileygit committed Jun 20, 2024
1 parent 1b25540 commit f5e89c0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ def setup_resolver(self) -> AbstractResolver:
)

def initialize(self, evaluation_context: EvaluationContext) -> None:
if hasattr(self.resolver, "initialize"):
self.resolver.initialize(evaluation_context)
self.resolver.initialize(evaluation_context)

def shutdown(self) -> None:
if self.resolver:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@


class AbstractResolver(Protocol):
def initialize(self, evaluation_context: EvaluationContext) -> None:
return

def shutdown(self) -> None: ...

def resolve_boolean_details(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
from ..config import Config
from ..flag_type import FlagType
from ..proto.schema.v1 import schema_pb2, schema_pb2_grpc
from . import AbstractResolver

T = typing.TypeVar("T")


class GrpcResolver:
class GrpcResolver(AbstractResolver):
def __init__(self, config: Config):
self.config = config
channel_factory = (
Expand Down

0 comments on commit f5e89c0

Please sign in to comment.