pyarrow.flight.FlightClient#

classpyarrow.flight.FlightClient(location,tls_root_certs=None,*,cert_chain=None,private_key=None,override_hostname=None,middleware=None,write_size_limit_bytes=None,disable_server_verification=None,generic_options=None)#

Bases:_Weakrefable

A client to a Flight service.

Connect to a Flight service on the given host and port.

Parameters:
locationstr,tuple orLocation

Location to connect to. Either a gRPC URI likegrpc://localhost:port,a tuple of (host, port) pair, or a Location instance.

tls_root_certsbytes orNone

PEM-encoded

cert_chain: bytes or None

Client certificate if using mutual TLS

private_key: bytes or None

Client private key for cert_chain is using mutual TLS

override_hostnamestr orNone

Override the hostname checked by TLS. Insecure, use with caution.

middlewarelist optional, defaultNone

A list of ClientMiddlewareFactory instances.

write_size_limit_bytesint optional, defaultNone

A soft limit on the size of a data payload sent to theserver. Enabled if positive. If enabled, writing a recordbatch that (when serialized) exceeds this limit will raise anexception; the client can retry the write with a smallerbatch.

disable_server_verificationbool optional, defaultFalse

A flag that indicates that, if the client is connectingwith TLS, that it skips server verification. If this isenabled, all other TLS settings are overridden.

generic_optionslist optional, defaultNone

A list of generic (string, int or string) option tuples passedto the underlying transport. Effect is implementationdependent.

__init__(*args,**kwargs)#

Methods

__init__(*args, **kwargs)

as_async(self)

authenticate(self, auth_handler, ...)

Authenticate to the server.

authenticate_basic_token(self, username, ...)

Authenticate to the server with HTTP basic authentication.

close(self)

Close the client and disconnect.

connect(cls, location[, tls_root_certs, ...])

Connect to a Flight server.

do_action(self, action, ...)

Execute an action on a service.

do_exchange(self, ...)

Start a bidirectional data exchange with a server.

do_get(self, Ticket ticket, ...)

Request the data for a flight.

do_put(self, FlightDescriptor descriptor, ...)

Upload data to a flight.

get_flight_info(self, ...)

Request information about an available flight.

get_schema(self, ...)

Request schema for an available flight.

list_actions(self, FlightCallOptions options)

List the actions available on a service.

list_flights(self, bytes criteria, ...)

List the flights available on a service.

wait_for_available(self[, timeout])

Block until the server can be contacted.

Attributes

as_async(self)None#
authenticate(self,auth_handler,FlightCallOptionsoptions:FlightCallOptions=None)#

Authenticate to the server.

Parameters:
auth_handlerClientAuthHandler

The authentication mechanism to use.

optionsFlightCallOptions

Options for this call.

authenticate_basic_token(self,username,password,FlightCallOptionsoptions:FlightCallOptions=None)#

Authenticate to the server with HTTP basic authentication.

Parameters:
usernamestr

Username to authenticate with

passwordstr

Password to authenticate with

optionsFlightCallOptions

Options for this call

Returns:
tupleTuple[str,str]

A tuple representing the FlightCallOptions authorizationheader entry of a bearer token.

close(self)#

Close the client and disconnect.

classmethodconnect(cls,location,tls_root_certs=None,cert_chain=None,private_key=None,override_hostname=None,disable_server_verification=None)#

Connect to a Flight server.

Deprecated since version 0.15.0:Use theFlightClient constructor orpyarrow.flight.connect function instead.

do_action(self,action,FlightCallOptionsoptions:FlightCallOptions=None)#

Execute an action on a service.

Parameters:
actionstr,tuple, orAction

Can be action type name (no body), type and body, or any Actionobject

optionsFlightCallOptions

RPC options

Returns:
resultsiterator ofResult values
do_exchange(self,FlightDescriptordescriptor:FlightDescriptor,FlightCallOptionsoptions:FlightCallOptions=None)#

Start a bidirectional data exchange with a server.

Parameters:
descriptorFlightDescriptor

A descriptor for the flight.

optionsFlightCallOptions

RPC options.

Returns:
writerFlightStreamWriter
readerFlightStreamReader
do_get(self,Ticketticket:Ticket,FlightCallOptionsoptions:FlightCallOptions=None)#

Request the data for a flight.

Returns:
readerFlightStreamReader
do_put(self,FlightDescriptordescriptor:FlightDescriptor,Schemaschema,FlightCallOptionsoptions:FlightCallOptions=None)#

Upload data to a flight.

Returns:
writerFlightStreamWriter
readerFlightMetadataReader
get_flight_info(self,FlightDescriptordescriptor:FlightDescriptor,FlightCallOptionsoptions:FlightCallOptions=None)#

Request information about an available flight.

get_schema(self,FlightDescriptordescriptor:FlightDescriptor,FlightCallOptionsoptions:FlightCallOptions=None)#

Request schema for an available flight.

list_actions(self,FlightCallOptionsoptions:FlightCallOptions=None)#

List the actions available on a service.

list_flights(self,bytescriteria:bytes=None,FlightCallOptionsoptions:FlightCallOptions=None)#

List the flights available on a service.

supports_async#
wait_for_available(self,timeout=5)#

Block until the server can be contacted.

Parameters:
timeoutint, default 5

The maximum seconds to wait.