imbajin commented on code in PR #329:
URL: https://github.com/apache/hugegraph-ai/pull/329#discussion_r3241581104
##########
hugegraph-python-client/src/pyhugegraph/api/graph.py:
##########
@@ -200,8 +200,10 @@ def getVerticesById(self, vertex_ids) -> list[VertexData]
| None:
if not vertex_ids:
return []
path = "traversers/vertices?"
- for vertex_id in vertex_ids:
- path += f'ids="{vertex_id}"&' # pylint:
disable=consider-using-join
+ quoted_vertex_ids = map(json.dumps, vertex_ids)
+
+ for vertex_id in quoted_vertex_ids:
+ path += f'ids={vertex_id}&' # pylint: disable=consider-using-join
path = path.rstrip("&")
Review Comment:
⚠️ No test added for `getVerticesById` with numeric IDs. This is the only
changed code path in this method but none of the new test cases call it with an
integer vertex ID. Please add a test (once the `department` schema ID strategy
is fixed):
```python
def test_get_vertices_by_number_id(self):
vertex = self.graph.addVertex("department", {"name": "DeptA",
"headcount": 10, "floor": 1})
result = self.graph.getVerticesById([vertex.id])
self.assertIsNotNone(result)
self.assertEqual(result[0].id, vertex.id)
```
--
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]