3030
3131_logger = logging .getLogger (__name__ )
3232
33- PANEL_INTERFACE = "ni.panels.v1.PanelService"
33+ PANEL_SERVICE = "ni.panels.v1.PanelService"
3434
3535
3636class _PanelClient :
3737 def __init__ (
3838 self ,
3939 * ,
40- service_class : str | None = None ,
4140 discovery_client : DiscoveryClient | None = None ,
4241 grpc_channel_pool : GrpcChannelPool | None = None ,
4342 grpc_channel : grpc .Channel | None = None ,
4443 ) -> None :
4544 self ._initialization_lock = threading .Lock ()
46- self ._service_class = service_class
4745 self ._discovery_client = discovery_client
4846 self ._grpc_channel_pool = grpc_channel_pool
4947 self ._grpc_channel = grpc_channel
@@ -98,7 +96,7 @@ def _get_stub(self) -> PanelServiceStub:
9896 if self ._stub is None :
9997 if self ._grpc_channel is not None :
10098 self ._stub = PanelServiceStub (self ._grpc_channel )
101- elif self . _service_class is not None :
99+ else :
102100 with self ._initialization_lock :
103101 if self ._grpc_channel_pool is None :
104102 _logger .debug ("Creating unshared GrpcChannelPool." )
@@ -110,13 +108,10 @@ def _get_stub(self) -> PanelServiceStub:
110108 )
111109
112110 service_location = self ._discovery_client .resolve_service (
113- provided_interface = PANEL_INTERFACE ,
114- service_class = self ._service_class ,
111+ provided_interface = PANEL_SERVICE
115112 )
116113 channel = self ._grpc_channel_pool .get_channel (service_location .insecure_address )
117114 self ._stub = PanelServiceStub (channel )
118- else :
119- raise TypeError ("Either grpc_channel or service_class must be provided." )
120115 return self ._stub
121116
122117 def _invoke_with_retry (
0 commit comments