Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions graphdatascience/query_runner/gds_arrow_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ def request_token(self) -> Optional[str]:
a token from the server and returns it.
"""
if self._auth:
self._flight_client.authenticate_basic_token(self._auth[0], self._auth[1])
client = self._client()
client.authenticate_basic_token(self._auth[0], self._auth[1])
return self._auth_middleware.token()
else:
return "IGNORED"
Expand Down Expand Up @@ -654,8 +655,9 @@ def _do_get(

ticket = flight.Ticket(json.dumps(payload).encode("utf-8"))

client = self._client()
try:
get = self._flight_client.do_get(ticket)
get = client.do_get(ticket)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense.

arrow_table = get.read_all()
except Exception as e:
self.handle_flight_error(e)
Expand Down Expand Up @@ -683,10 +685,11 @@ def __exit__(
exception_value: Optional[BaseException],
traceback: Optional[TracebackType],
) -> None:
self._flight_client.close()
self.close()

def close(self) -> None:
self._flight_client.close()
if self._flight_client:
self._flight_client.close()

def _versioned_action_type(self, action_type: str) -> str:
return self._arrow_endpoint_version.prefix() + action_type
Expand Down