Skip to content

Commit 7b2deb7

Browse files
soerenreichardtFlorentinD
authored andcommitted
Make return clause check case-insensitive
1 parent a7a2ee0 commit 7b2deb7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

graphdatascience/graph/graph_cypher_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def _verify_query_ends_with_return_clause(namespace: str, query: str) -> None:
103103
at_end = True
104104
break
105105

106-
if query_token == "RETURN":
106+
if query_token.upper() == "RETURN":
107107
# State 1: We found the start of a `RETURN` clause.
108108
# Check if it is the `RETURN gds.graph.project` call.
109109
# We split tokens on `__separators` and flatten the nested iters.

graphdatascience/tests/unit/test_graph_cypher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ def test_with_multiple_returns(gds: GraphDataScience) -> None:
107107
"MATCH (s)-->(t) RETURN gds.graph.project('g' + foo, s, t)",
108108
"MATCH (s)-->(t) RETURN gds.graph.project('g' + CALL foo(bar), s, t)",
109109
"MATCH (s)-->(t) RETURN gds.graph.project($graph_name, s, t)",
110-
"MATCH (s)-->(t) RETURN gds.graph.project($the_gg, s, t)",
111-
"MATCH (s)-->(t) RETURN gds.graph.project($graph_name, s, t, { property: labels(s) })",
110+
"MATCH (s)-->(t) ReTuRn gds.graph.project($the_gg, s, t)",
111+
"MATCH (s)-->(t) return gds.graph.project($graph_name, s, t, { property: labels(s) })",
112112
],
113113
)
114114
def test_verify_query_ends_with_return_clause(query: str) -> None:

0 commit comments

Comments
 (0)