Skip to content

Commit 226a23d

Browse files
committed
Fix handle_flight_error for ClientError case
1 parent 58577bd commit 226a23d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

graphdatascience/query_runner/gds_arrow_client.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -865,12 +865,8 @@ def _decode_pyarrow_array(array: Array) -> Array:
865865

866866
@staticmethod
867867
def handle_flight_error(e: Exception) -> None:
868-
if (
869-
isinstance(e, flight.FlightServerError)
870-
or isinstance(e, flight.FlightInternalError)
871-
or isinstance(e, ClientError)
872-
):
873-
original_message = e.args[0]
868+
if isinstance(e, flight.FlightServerError | flight.FlightInternalError | ClientError):
869+
original_message = e.args[0] if len(e.args) > 0 else e.message
874870
improved_message = original_message.replace(
875871
"Flight RPC failed with message: org.apache.arrow.flight.FlightRuntimeException: ", ""
876872
)

0 commit comments

Comments
 (0)