imbajin commented on code in PR #115:
URL:
https://github.com/apache/incubator-hugegraph-ai/pull/115#discussion_r1844996619
##########
hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/graph_rag_query.py:
##########
@@ -237,7 +237,7 @@ def _process_vertex(self, item: Any, flat_rel: str,
node_cache: Set[str],
return flat_rel, prior_edge_str_len, depth
node_cache.add(matched_str)
- props_str = ", ".join(f"{k}: {v}" for k, v in item["props"].items())
+ props_str = ", ".join(f"{k}: {v}" for k, v in item["props"].items() if
str(v).strip())
Review Comment:
```suggestion
props_str = ", ".join(f"{k}: {v}" for k, v in item["props"].items()
if v)
```
avoid extra O(n) operatio & also exclude `False` / `[]` / `0` / None
together?
Note: if we do need `False` or `0`. could add a method for 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]