You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hugegraph.apache.org by "ChenZiHong-Gavin (via GitHub)" <gi...@apache.org> on 2024/11/16 14:26:51 UTC
[PR] fix: null value detection on vid attributes [incubator-hugegraph-ai]
ChenZiHong-Gavin opened a new pull request, #115:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/115
(no comment)
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] fix: null value detection on vid attributes [incubator-hugegraph-ai]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
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)
```
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] fix: null value detection on vid attributes [incubator-hugegraph-ai]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] fix: null value detection on vid attributes [incubator-hugegraph-ai]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
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)` str operation & also exclude `False` / `[]` / `0` / None together?
Note: if we do need `False` or `0` or want to exclude "None" str. could add a method for it
##########
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)` str operation & also exclude `False` / `[]` / `0` / None together?
Note: if we do need `False` or `0` or want to exclude "null/None" str. 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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] fix: null value detection on vid attributes [incubator-hugegraph-ai]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on code in PR #115:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/115#discussion_r1846261926
##########
hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/graph_rag_query.py:
##########
@@ -252,7 +252,7 @@ def _process_vertex(self, item: Any, flat_rel: str, node_cache: Set[str],
def _process_edge(self, item: Any, flat_rel: str, prior_edge_str_len: int,
raw_flat_rel: List[Any], i: int, use_id_to_match: bool, e_cache: Set[str]) -> Tuple[str, int]:
- 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)
```
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] fix: null value detection on vid attributes [incubator-hugegraph-ai]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
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)` str operation & 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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] fix: null value detection on vid attributes [incubator-hugegraph-ai]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin merged PR #115:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/115
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org