Gardenia-zx commented on code in PR #323:
URL: https://github.com/apache/hugegraph-ai/pull/323#discussion_r3195541903


##########
hugegraph-llm/src/hugegraph_llm/operators/index_op/build_gremlin_example_index.py:
##########
@@ -38,14 +38,22 @@ def __init__(
         self.vector_index = vector_index
 
     def run(self, context: Dict[str, Any]) -> Dict[str, Any]:
-        # !: We have assumed that self.example is not empty
+        if not self.examples:
+            context["embed_dim"] = 0
+            return context

Review Comment:
   Thanks for the review. I updated the implementation to clean the existing 
gremlin_examples index before returning for the empty examples / empty 
embeddings cases, so stale examples will not be reused.
   
   I also aligned the node-level guard to reject only None and allow an empty 
examples list to reach the no-op path.
   
   Tests:
   uv run pytest 
src/tests/operators/index_op/test_build_gremlin_example_index.py -v
   uv run pytest src/tests/operators/index_op/ -v



-- 
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