imbajin commented on code in PR #320:
URL: https://github.com/apache/hugegraph-ai/pull/320#discussion_r3110998776
##########
hugegraph-python-client/src/pyhugegraph/api/gremlin.py:
##########
@@ -25,15 +25,19 @@
class GremlinManager(HugeParamsBase):
- @router.http("POST", "/gremlin")
+ @router.http("POST", "gremlin")
Review Comment:
‼️ **Critical Bug: Gremlin path direction reversed**
The change swaps `/gremlin` (absolute) → `gremlin` (relative), but this is
exactly **backwards** from the intent.
Looking at `huge_requests.py:resolve()` (lines 93-120):
- **Relative path** `gremlin` → gets the graph prefix prepended → final URL:
`http://host:8080/graphs/{graph}/gremlin` (**WRONG**)
- **Absolute path** `/gremlin` → replaces the path via `urljoin` → final
URL: `http://host:8080/gremlin` (**CORRECT**)
The HugeGraph server Gremlin endpoint is `/gremlin` (top-level, confirmed in
`GremlinAPI.java`), NOT under the per-graph path.
Compare with `auth.py` in this same PR: those changes correctly move from
`auth/users` → `/auth/users` to make them **absolute** (bypass graph prefix).
The gremlin change does the opposite and breaks it.
The comments added (`# For graphspace-supported versions (3.0+)` / `# For
HugeGraph 1.x`) are also misleading — this path change has nothing to do with
graphspace version branching; it affects URL resolution for both branches.
**Fix**: Revert to original `/gremlin`:
```suggestion
@router.http("POST", "/gremlin")
def exec(self, gremlin):
```
##########
hugegraph-python-client/src/pyhugegraph/api/schema_manage/vertex_label.py:
##########
@@ -64,6 +64,15 @@ def enableLabelIndex(self, flag) -> "VertexLabel":
self._parameter_holder.set("enable_label_index", flag)
return self
+ @decorator_params
+ def parent(self, parent_label) -> "VertexLabel":
+ """
+ Set parent vertex label for supporting parent & child vertex label
type (HugeGraph 1.7.0+).
+ When a vertex label has a parent, it becomes a child vertex label with
inherited properties.
+ """
+ self._parameter_holder.set("parent_label", parent_label)
Review Comment:
‼️ **Critical: `parent_label` for VertexLabel is NOT supported by HugeGraph
server**
Confirmed via `apache/hugegraph` codebase: parent/child label hierarchy
(`parent_label`) was introduced in **1.7.0 for edge labels ONLY**.
- `VertexLabelAPI` has NO `parent_label` field — `JsonVertexLabel` does not
contain this attribute
- Sending `parent_label` in a vertex label creation request will be silently
ignored or cause a server-side error
- Only `EdgeLabel` / `JsonEdgeLabel` has the `parent_label` and
`edgeLabelType` (PARENT/SUB) fields
The `edge_label.py` change is correct. This `vertex_label.py` change should
be removed.
Please either:
1. Remove the `parent()` method and `parent_label` key from `vertex_label.py`
2. Or provide a link to the server-side PR/commit that adds `parent_label`
to vertex labels
--
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]