Module Contents

class airflow.providers.grpc.hooks.grpc.GrpcHook(grpc_conn_id: str = default_conn_name, interceptors: Optional[List[Callable]] = None, custom_connection_func: Optional[Callable] = None)[source]

Bases: airflow.hooks.base.BaseHook

General interaction with gRPC servers.

  • grpc_conn_id (str) -- The connection ID to use when fetching connection info.

  • interceptors (a list of gRPC interceptors based on or extends the four official gRPC interceptors, eg, UnaryUnaryClientInterceptor, UnaryStreamClientInterceptor, StreamUnaryClientInterceptor, StreamStreamClientInterceptor.) -- a list of gRPC interceptor objects which would be applied to the connected gRPC channel. None by default.

  • custom_connection_func (python callable objects that accept the connection as its only arg. Could be partial or lambda.) -- The customized connection function to return gRPC channel.

conn_name_attr = grpc_conn_id[source]
default_conn_name = grpc_default[source]
conn_type = grpc[source]
hook_name = GRPC Connection[source]
static get_connection_form_widgets()[source]

Returns connection widgets to add to connection form

run(self, stub_class: Callable, call_func: str, streaming: bool = False, data: Optional[dict] = None)[source]

Call gRPC function and yield response to caller

Was this entry helpful?