Skip to content

Commit 7249c01

Browse files
Merge pull request #665 from soerenreichardt/avoid-deprecated-return-values
Avoid fetching deprecated return values
2 parents aafd14c + 4024e11 commit 7249c01

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

graphdatascience/query_runner/gds_arrow_client.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
class GdsArrowClient:
1919
@staticmethod
2020
def is_arrow_enabled(query_runner: QueryRunner) -> bool:
21-
arrow_info = query_runner.call_procedure(endpoint="gds.debug.arrow", custom_error=False).squeeze().to_dict()
22-
return not not arrow_info["running"]
21+
arrow_server_running = query_runner.call_procedure(
22+
endpoint="gds.debug.arrow", custom_error=False, yields=["running", "listenAddress"]
23+
).squeeze()
24+
return not not arrow_server_running["running"]
2325

2426
@staticmethod
2527
def create(
@@ -30,14 +32,20 @@ def create(
3032
tls_root_certs: Optional[bytes] = None,
3133
connection_string_override: Optional[str] = None,
3234
) -> "GdsArrowClient":
33-
arrow_info = query_runner.call_procedure(endpoint="gds.debug.arrow", custom_error=False).squeeze().to_dict()
35+
arrow_info = (
36+
query_runner.call_procedure(
37+
endpoint="gds.debug.arrow", custom_error=False, yields=["listenAddress", "versions"]
38+
)
39+
.squeeze()
40+
.to_dict()
41+
)
3442

3543
server_version = query_runner.server_version()
3644
connection_string: str
3745
if connection_string_override is not None:
3846
connection_string = connection_string_override
3947
else:
40-
connection_string = arrow_info.get("advertisedListenAddress", arrow_info["listenAddress"])
48+
connection_string = arrow_info.get("listenAddress")
4149

4250
host, port = connection_string.split(":")
4351

0 commit comments

Comments
 (0)