airflow.providers.grpc.hooks.grpc

GRPC Hook

Module Contents

Classes

GrpcHook

General interaction with gRPC servers.

class airflow.providers.grpc.hooks.grpc.GrpcHook(grpc_conn_id=default_conn_name, interceptors=None, custom_connection_func=None)[source]

Bases: airflow.hooks.base.BaseHook

General interaction with gRPC servers.

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

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

  • custom_connection_func (Optional[Callable]) -- The customized connection function to return gRPC channel. A callable that accepts the connection as its only arg.

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

get_conn(self)[source]

Returns connection for the hook.

run(self, stub_class, call_func, streaming=False, data=None)[source]

Call gRPC function and yield response to caller

Was this entry helpful?