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 (list[Callable] | None) – 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 (Callable | None) – 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]
classmethod get_connection_form_widgets()[source]

Return connection widgets to add to GRPC connection form.

get_conn()[source]

Return connection for the hook.

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

Call gRPC function and yield response to caller.

Was this entry helpful?