File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed
providers/openfeature-provider-flagd
src/openfeature/contrib/provider/flagd Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -55,9 +55,14 @@ cov = [
5555]
5656
5757[tool .hatch .build .hooks .protobuf ]
58- dependencies = [" hatch-protobuf" ]
59- paths = [" schemas/protobuf/schema/v1/schema.proto" , " schemas/protobuf/sync/v1/sync_service.proto" ]
60- output_path = " src"
58+ dependencies = [
59+ " hatch-protobuf"
60+ ]
61+ proto_paths = [
62+ " schemas/protobuf/flagd/evaluation/v1" ,
63+ " schemas/protobuf/flagd/sync/v1" ,
64+ ]
65+ output_path = " src/openfeature/contrib/provider/flagd/proto"
6166
6267[tool .hatch .build .targets .sdist ]
6368exclude = [
File renamed without changes.
Original file line number Diff line number Diff line change 33import grpc
44from google .protobuf .json_format import MessageToDict
55from google .protobuf .struct_pb2 import Struct
6- from schemas .protobuf .flagd .evaluation .v1 import ( # type:ignore[import-not-found]
7- evaluation_pb2 ,
8- evaluation_pb2_grpc ,
9- )
106
117from openfeature .evaluation_context import EvaluationContext
128from openfeature .exception import (
2016
2117from ..config import Config
2218from ..flag_type import FlagType
19+ from ..proto import evaluation_pb2 , evaluation_pb2_grpc # type:ignore[attr-defined]
2320
2421T = typing .TypeVar ("T" )
2522
@@ -86,6 +83,13 @@ def _resolve( # noqa: PLR0915
8683 context = self ._convert_context (evaluation_context )
8784 call_args = {"timeout" : self .config .timeout }
8885 try :
86+ request : typing .Union [
87+ evaluation_pb2 .ResolveBooleanRequest ,
88+ evaluation_pb2 .ResolveIntRequest ,
89+ evaluation_pb2 .ResolveStringRequest ,
90+ evaluation_pb2 .ResolveObjectRequest ,
91+ evaluation_pb2 .ResolveFloatRequest ,
92+ ]
8993 if flag_type == FlagType .BOOLEAN :
9094 request = evaluation_pb2 .ResolveBooleanRequest (
9195 flag_key = flag_key , context = context
You can’t perform that action at this time.
0 commit comments