Skip to content

Commit 7231708

Browse files
committed
Increase grpc max message length
1 parent e783a41 commit 7231708

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/altertable_flightsql/client.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
from altertable_flightsql.generated import arrow_flight_sql_pb2 as sql_pb2
1818

19+
GRPC_MAX_MESSAGE_LENGTH = 512 * 1024 * 1024
20+
1921

2022
def _pack_command(cmd) -> bytes:
2123
"""Pack a Flight SQL command into an Any protobuf message."""
@@ -137,7 +139,14 @@ def __init__(
137139
self._transaction = None
138140

139141
auth_middleware = BearerAuthMiddlewareFactory()
140-
self._client = flight.FlightClient(location, middleware=[auth_middleware])
142+
self._client = flight.FlightClient(
143+
location,
144+
middleware=[auth_middleware],
145+
generic_options=[
146+
("grpc.max_send_message_length", GRPC_MAX_MESSAGE_LENGTH),
147+
("grpc.max_receive_message_length", GRPC_MAX_MESSAGE_LENGTH),
148+
],
149+
)
141150
self._client.authenticate_basic_token(self._username, self._password)
142151

143152
options = {}

0 commit comments

Comments
 (0)