doc(ai): sync hugegraph-python-client with main - #483
Open
bitflicker64 wants to merge 1 commit into
Open
Conversation
Verify install command against packaging metadata, correct the PyHugeClient signature and workspace sync command, document the 1.5.0 server floor and GraphSpace resolution, and add the manager, traverser, task, variable, metrics, auth and error-handling sections the pages were missing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Syncs the HugeGraph Python client quick start (en and cn) with
apache/hugegraph-ai@mainat version 1.7.0. Every change below traces to a file onmain.Note on the PyPI package name
hugegraph-pythonon PyPI is the Apache-published distribution (latest 1.5.0, authorApache HugeGraph Contributors <dev@hugegraph.apache.org>).hugegraph-python-clienton PyPI is an unrelated empty 0.1.1 placeholder with no author, license or project URLs. The repo declares the distribution ashugegraph-python-client1.7.0, but nothing has shipped under that name. The install command is therefore left ashugegraph-pythonand the naming and version gap is documented on the page, rather than "fixed" into a command that does not work.uv syncfrom the repo root installs the clientuv sync --extra python-client; the client is a workspace member reached only through that extrapyproject.toml:40,93-97,.github/workflows/hugegraph-python-client.yml:52RuntimeErroron older servers and points at client v1.3.xhugegraph-python-client/src/pyhugegraph/utils/huge_config.py:66-71hugegraph-python-client/pyproject.toml:27,pyproject.toml:27,.github/workflows/hugegraph-python-client.yml:22hugegraph-python(verified correct) and noted that the in-repo distribution ishugegraph-python-client1.7.0 and the PyPI release lagshugegraph-python-client/pyproject.toml:19-20,hugegraph-python-client/README.md:15-16decorator,requests,setuptools,urllib3,richhugegraph-python-client/pyproject.toml:29-36"127.0.0.1:8080"positionally with no parameter referencePyHugeClient(url, graph, user, pwd, graphspace=None, timeout=None)plus a parameter table, includingtimeoutdefaulting to(0.5, 15.0)hugegraph-python-client/src/pyhugegraph/client.py:50-59graphspace; the default space is usuallyDEFAULT"GET {url}/versions; server < 1.5.0 raises, > 1.5.0 auto-setsDEFAULTand enables the mode, exactly 1.5.0 stays off, network failure stays off; plus the resulting URL prefix.../utils/huge_config.py:39-92,.../utils/huge_requests.py:113-121RankManager,RebuildManagerandServicesManagership but are not exposed.../client.py:61-99,.../api/rank.py:27,.../api/rebuild.py:23,.../api/services.py:24.../api/schema_manage/property_key.py:30-180,vertex_label.py:28-138,edge_label.py:30-161,index_label.py:30-100getSchema, the single-item getters andgetRelationsPerson--ActedIn-->Movieoutput shape.../api/schema.py:65-132appendVertex,removeEdgeById,removeVertexByIdeliminateVertex,appendEdge,eliminateEdge, theVertexDataandEdgeDatafields, and the vertex-id type rules.../api/graph.py:50-62,140-158,.../structure/vertex_data.py:27-39,.../structure/edge_data.py:31-59,.../utils/id_format.py:27-47addVerticestakes(label, properties)pairs,addEdgestakes 6-tuples; both return id-only objects.../api/graph.py:41-48,122-138getVertexByPagereturns(items, next_page),getVertexByCondition,getEdgeByPage(direction required withvertex_id),getVerticesById,getEdgesById.../api/graph.py:70-104,166-221execbindsgraphandgfrom the graph name and GraphSpace, returnsresult, raisesResponseParseErroron a malformed payload.../api/gremlin.py:26,30-56TraverserManagerwith the snake_case methods and the POST-body variants.../api/traverser.py:31-250set,get,all,remove.../api/variable.py:24-39list_tasks(status, limit),get_task,cancel_task,delete_task.../api/task.py:22-42get_all_graphs/get_version/get_graph_info/get_graph_config/clear_graph_all_data, andversion().../api/metric.py:22-57,.../api/graphs.py:25-62,.../api/version.py:22-25AuthManagerwith graphspace-scoped users, targets, belongs and accesses, server-level groups, and theValueErrorraised on 1.7.0+ when no graphspace resolves.../api/auth.py:25-209,.../utils/huge_router.py:134-149.../api/common.py:85-101NotAuthorizedError, 404 toNotFoundError, other non-2xx toServerError) plus the credential redaction behaviour.../utils/exceptions.py:19-76,.../utils/util.py:66-95,166-206.../utils/huge_requests.py:36-39,63-72HUGEGRAPH_*env vars and thehugegraph/hugegraph:1.7.0CI image.github/workflows/hugegraph-python-client.yml:56,74,111-119,hugegraph-python-client/src/tests/client_utils.py:39-43hugegraph-python-client/src/pyhugegraph/example/hugegraph_example.py.../example/hugegraph_example.py:21-58Upstream defects found while reading the code
Not fixed here, they belong in
apache/hugegraph-ai.hugegraph-python-client/README.mdis stale in ways the doc pages no longer are:README.md:48callsPyHugeClient("127.0.0.1", "8080", user=..., pwd=..., graph=..., graphspace=...), which raisesTypeErroragainst the current signature, sincegraphis the second positional parameter (src/pyhugegraph/client.py:50-59).README.md:124-160usesaddVertex('person').property(...).create(),updateVertex(...),deleteVertex(...)anddeleteEdge(...), none of which exist onGraphManager(src/pyhugegraph/api/graph.py).Correction for a page this PR does not own
content/en/docs/quickstart/client/hugegraph-client.md:11and itscncounterpart link the Python client to the GitHub source tree,https://github.com/apache/hugegraph-ai/tree/main/hugegraph-python-client, while the sibling Go client link is an internal doc link. It should point at/docs/quickstart/client/hugegraph-client-pythoninstead, now that this page is the fuller reference. Left for the owner of that page.