Skip to content

Commit 031dc83

Browse files
committed
Fix expected type from cypher projection result_df.squeeze()
1 parent 74b64ae commit 031dc83

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

graphdatascience/graph/graph_cypher_runner.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import re
44
from itertools import chain, zip_longest
5-
from typing import Any, Optional
5+
from typing import Any, Dict, Optional
66

77
from pandas import Series
88

@@ -45,9 +45,9 @@ def project(
4545

4646
GraphCypherRunner._verify_query_ends_with_return_clause(self._namespace, query)
4747

48-
result: Optional[Series[Any]] = self._query_runner.run_cypher(query, params, database, False).squeeze()
48+
result: Optional[Dict[str, Any]] = self._query_runner.run_cypher(query, params, database, False).squeeze()
4949

50-
if result is None or result.empty:
50+
if not result:
5151
raise ValueError("Projected graph cannot be empty.")
5252

5353
try:
@@ -57,7 +57,7 @@ def project(
5757
f"Invalid query, the query must end with the `RETURN {self._namespace}(...)` call: {query}"
5858
)
5959

60-
return GraphCreateResult(Graph(graph_name, self._query_runner, self._server_version), result)
60+
return GraphCreateResult(Graph(graph_name, self._query_runner, self._server_version), Series(data=result))
6161

6262
__separators = re.compile(r"[,(.]")
6363

0 commit comments

Comments
 (0)