bitflicker64 commented on code in PR #383:
URL: https://github.com/apache/hugegraph-ai/pull/383#discussion_r4282003844


##########
hugegraph-llm/src/hugegraph_llm/utils/hugegraph_utils.py:
##########
@@ -34,6 +34,11 @@
 BACKUP_DIR = str(os.path.join(resource_path, "backup-graph-data-4020", 
huge_settings.graph_name))
 
 
+def gremlin_str_literal(value) -> str:

Review Comment:
   Important: nothing calls this helper at the PR head, so the fix is not in 
the PR. The last commit, baf1bcc, reverts all three call sites that 3f7b54c 
changed:
   
   - `semantic_id_query.py` `_exact_match_vids`: `vids_str = 
",".join([f"'{vid}'" for vid in possible_vids])`
   - `graph_query_node.py` `_subgraph_query`: 
`VERTEX_QUERY_TPL.format(keywords=matched_vids)`, `keywords=f"'{matched_vid}'"` 
for the neighbor query, and `"'" + kw + "'"` on the property path
   - `graph_index_utils.py` `get_vertex_details`: `f"'{vid}'"`
   
   The diff against `main` therefore only adds this function and the tests. A 
keyword or vertex id with an apostrophe still produces `g.V('1:O'Brien')`, 
which is the failure the PR description reports. The three new regression tests 
fail at this head: running `test_graph_query_node.py`, 
`test_graph_index_utils.py` and `test_semantic_id_query.py` gives 3 failed, 
each with `ServerError: startup failed: unterminated string literal` raised by 
`FakeGremlinEndpoint`. With the `hugegraph_llm` sources from 3f7b54c and the 
tests from this head, all 16 tests pass. Please restore the 
`gremlin_str_literal(...)` calls in those three files (and the imports), and 
keep the list-form handling in `FakeGremlinEndpoint` only if a test still needs 
it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to