Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions changelog/1.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
## Bug fixes

* Fixed a bug where the `separate_property_columns=True` option of `gds.graph.streamNodeProperties` did not handle list node properties correctly.
* Fixed a bug where an irrelevant warning was shown when creating a `GraphDataScience` object targeting an AuraDS instance with GDS server version >= 2.1.0.
* Fixed a bug where calling `gds.alpha.graph.construct` targeting an AuraDS instance would raise an exception.


## Improvements
Expand Down
8 changes: 7 additions & 1 deletion graphdatascience/graph_data_science.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ def __init__(
arrow_info["listenAddress"], self._query_runner, auth, driver.encrypted, True
)
except Exception as e:
warnings.warn(f"Could not initialize GDS Flight Server client: {e}")
# AuraDS does not have arrow support at this time, so we should not warn about it.
# TODO: Remove this check when AuraDS gets arrow support.
if (
"There is no procedure with the name `gds.debug.arrow` "
"registered for this database instance." not in str(e)
):
warnings.warn(f"Could not initialize GDS Flight Server client: {e}")

super().__init__(self._query_runner, "gds", self._server_version)

Expand Down
25 changes: 18 additions & 7 deletions graphdatascience/query_runner/cypher_graph_constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(
self._graph_name = graph_name

def run(self, node_dfs: List[DataFrame], relationship_dfs: List[DataFrame]) -> None:
if self._is_enterprise():
if self._should_warn_about_arrow_missing():
warnings.warn(
"GDS Enterprise users can use Apache Arrow for fast graph construction; please see the documentation "
"for instructions on how to enable it. Without Arrow enabled, this installation will use community "
Expand Down Expand Up @@ -55,12 +55,23 @@ def run(self, node_dfs: List[DataFrame], relationship_dfs: List[DataFrame]) -> N
},
)

def _is_enterprise(self) -> bool:
license: str = self._query_runner.run_query(
"CALL gds.debug.sysInfo() YIELD key, value WHERE key = 'gdsEdition' RETURN value"
).squeeze()

return license == "Licensed"
def _should_warn_about_arrow_missing(self) -> bool:
try:
license: str = self._query_runner.run_query(
"CALL gds.debug.sysInfo() YIELD key, value WHERE key = 'gdsEdition' RETURN value"
).squeeze()
should_warn = license == "Licensed"
except Exception as e:
# It's not a user's concern whether Arrow is set up or not in AuraDS.
if (
"There is no procedure with the name `gds.debug.sysInfo` "
"registered for this database instance." in str(e)
):
should_warn = False
else:
raise e

return should_warn

def _node_query(self, node_df: DataFrame) -> Tuple[str, List[List[Any]]]:
node_list = node_df.values.tolist()
Expand Down
16 changes: 13 additions & 3 deletions graphdatascience/system/system_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,18 @@ def debug(self) -> DebugProcRunner:

@client_only_endpoint("gds")
def is_licensed(self) -> bool:
license: str = self._query_runner.run_query(
"CALL gds.debug.sysInfo() YIELD key, value WHERE key = 'gdsEdition' RETURN value"
).squeeze()
try:
license: str = self._query_runner.run_query(
"CALL gds.debug.sysInfo() YIELD key, value WHERE key = 'gdsEdition' RETURN value"
).squeeze()
except Exception as e:
# AuraDS does not have `gds.debug.sysInfo`, but is always GDS EE.
if (
"There is no procedure with the name `gds.debug.sysInfo` "
"registered for this database instance." in str(e)
):
license = "Licensed"
else:
raise e

return license == "Licensed"