Skip to content

Commit 54f37ab

Browse files
Avoid fetching deprecated return values
1 parent b476162 commit 54f37ab

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

graphdatascience/query_runner/gds_arrow_client.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
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 = (
22+
query_runner.call_procedure(endpoint="gds.debug.arrow", custom_error=False, yields=["running"])
23+
.squeeze()
24+
)
25+
return not not arrow_server_running
2326

2427
@staticmethod
2528
def create(
@@ -30,14 +33,20 @@ def create(
3033
tls_root_certs: Optional[bytes] = None,
3134
connection_string_override: Optional[str] = None,
3235
) -> "GdsArrowClient":
33-
arrow_info = query_runner.call_procedure(endpoint="gds.debug.arrow", custom_error=False).squeeze().to_dict()
36+
arrow_info = (
37+
query_runner.call_procedure(
38+
endpoint="gds.debug.arrow", custom_error=False, yields=["listenAddress", "versions"]
39+
)
40+
.squeeze()
41+
.to_dict()
42+
)
3443

3544
server_version = query_runner.server_version()
3645
connection_string: str
3746
if connection_string_override is not None:
3847
connection_string = connection_string_override
3948
else:
40-
connection_string = arrow_info.get("advertisedListenAddress", arrow_info["listenAddress"])
49+
connection_string = arrow_info.get("listenAddress")
4150

4251
host, port = connection_string.split(":")
4352

0 commit comments

Comments
 (0)