pyarrow.flight.FlightClient¶
- class pyarrow.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:
- location
str
,tuple
orLocation
Location to connect to. Either a gRPC URI like grpc://localhost:port, a tuple of (host, port) pair, or a Location instance.
- tls_root_certs
bytes
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_hostname
str
orNone
Override the hostname checked by TLS. Insecure, use with caution.
- middleware
list
optional, defaultNone
A list of ClientMiddlewareFactory instances.
- write_size_limit_bytes
int
optional, defaultNone
A soft limit on the size of a data payload sent to the server. Enabled if positive. If enabled, writing a record batch that (when serialized) exceeds this limit will raise an exception; the client can retry the write with a smaller batch.
- disable_server_verificationbool optional, default
False
A flag that indicates that, if the client is connecting with TLS, that it skips server verification. If this is enabled, all other TLS settings are overridden.
- generic_options
list
optional, defaultNone
A list of generic (string, int or string) option tuples passed to the underlying transport. Effect is implementation dependent.
- location
- __init__(*args, **kwargs)¶
Methods
__init__
(*args, **kwargs)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
(type cls, location[, ...])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.
- authenticate(self, auth_handler, FlightCallOptions options: 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, FlightCallOptions options: 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.
- connect(type 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
FlightClient
constructor orpyarrow.flight.connect
function instead.
- do_action(self, action, FlightCallOptions options: 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 Action object
- options
FlightCallOptions
RPC options
- action
- Returns:
- resultsiterator of
Result
values
- resultsiterator of
- do_exchange(self, FlightDescriptor descriptor: FlightDescriptor, FlightCallOptions options: 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, Ticket ticket: Ticket, FlightCallOptions options: FlightCallOptions = None)¶
Request the data for a flight.
- Returns:
- reader
FlightStreamReader
- reader
- do_put(self, FlightDescriptor descriptor: FlightDescriptor, Schema schema: Schema, FlightCallOptions options: FlightCallOptions = None)¶
Upload data to a flight.
- Returns:
- writer
FlightStreamWriter
- reader
FlightMetadataReader
- writer
- get_flight_info(self, FlightDescriptor descriptor: FlightDescriptor, FlightCallOptions options: FlightCallOptions = None)¶
Request information about an available flight.
- get_schema(self, FlightDescriptor descriptor: FlightDescriptor, FlightCallOptions options: FlightCallOptions = None)¶
Request schema for an available flight.
- list_actions(self, FlightCallOptions options: FlightCallOptions = None)¶
List the actions available on a service.
- list_flights(self, bytes criteria: bytes = None, FlightCallOptions options: FlightCallOptions = None)¶
List the flights available on a service.