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:
_WeakrefableA client to a Flight service.
Connect to a Flight service on the given host and port.
- Parameters:
- location
str,tupleorLocation Location to connect to. Either a gRPC URI likegrpc://localhost:port,a tuple of (host, port) pair, or a Location instance.
- tls_root_certs
bytesorNone 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_hostname
strorNone Override the hostname checked by TLS. Insecure, use with caution.
- middleware
listoptional, defaultNone A list of ClientMiddlewareFactory instances.
- write_size_limit_bytes
intoptional, 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, default
False 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_options
listoptional, defaultNone A list of generic (string, int or string) option tuples passedto the underlying transport. Effect is implementationdependent.
- location
- __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
- authenticate(self,auth_handler,FlightCallOptionsoptions:FlightCallOptions=None)#
Authenticate to the server.
- Parameters:
- auth_handler
ClientAuthHandler The authentication mechanism to use.
- options
FlightCallOptions Options for this call.
- auth_handler
- authenticate_basic_token(self,username,password,FlightCallOptionsoptions:FlightCallOptions=None)#
Authenticate to the server with HTTP basic authentication.
- Parameters:
- username
str Username to authenticate with
- password
str Password to authenticate with
- options
FlightCallOptions Options for this call
- username
- Returns:
- 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 the
FlightClientconstructor orpyarrow.flight.connectfunction instead.
- do_action(self,action,FlightCallOptionsoptions:FlightCallOptions=None)#
Execute an action on a service.
- Parameters:
- action
str,tuple, orAction Can be action type name (no body), type and body, or any Actionobject
- options
FlightCallOptions RPC options
- action
- Returns:
- resultsiterator of
Resultvalues
- resultsiterator of
- do_exchange(self,FlightDescriptordescriptor:FlightDescriptor,FlightCallOptionsoptions:FlightCallOptions=None)#
Start a bidirectional data exchange with a server.
- Parameters:
- descriptor
FlightDescriptor A descriptor for the flight.
- options
FlightCallOptions RPC options.
- descriptor
- Returns:
- writer
FlightStreamWriter - reader
FlightStreamReader
- writer
- do_get(self,Ticketticket:Ticket,FlightCallOptionsoptions:FlightCallOptions=None)#
Request the data for a flight.
- Returns:
- reader
FlightStreamReader
- reader
- do_put(self,FlightDescriptordescriptor:FlightDescriptor,Schemaschema,FlightCallOptionsoptions:FlightCallOptions=None)#
Upload data to a flight.
- Returns:
- writer
FlightStreamWriter - reader
FlightMetadataReader
- writer
- 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#

