Skip to content

refactor: replace the IP + Port with URL#209

Merged
imbajin merged 8 commits intoapache:mainfrom
mingfang:main
May 9, 2025
Merged

refactor: replace the IP + Port with URL#209
imbajin merged 8 commits intoapache:mainfrom
mingfang:main

Conversation

@mingfang
Copy link
Contributor

@mingfang mingfang commented Apr 15, 2025

This pull request refactors multiple modules to replace separate IP and port parameters with a unified URL parameter, addressing issue (fix #191). Key changes include updating configuration classes, client constructors, and example/test files to use "url" consistently, as well as modifying related API endpoints and configuration docs.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 15, 2025
@dosubot dosubot bot added the bug Something isn't working label Apr 15, 2025
@imbajin imbajin requested a review from Copilot April 15, 2025 06:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

hugegraph-llm/src/hugegraph_llm/api/rag_api.py:142

  • The function call 'apply_graph_conf' appears inconsistent with the similarly defined function 'apply_graph_config' (as seen in the configs_block file). Consider unifying the function name to avoid potential confusion.
res = apply_graph_conf(req.url, req.name, req.user, req.pwd, req.gs, origin_call="http")

Comment on lines -252 to -255
gr.Textbox(value=huge_settings.graph_ip, label="ip"),
gr.Textbox(value=huge_settings.graph_port, label="port"),
Copy link
Member

@imbajin imbajin Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

index error here? (start the app.py)

/hugegraph_llm/demo/rag_demo/app.py", line 140, in init_rag_ui
    textbox_array_graph_config[5],
IndexError: list index out of range

Update: I fixed it in 2da1a78

Copy link
Member

@imbajin imbajin Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Also we need run the process to check other function (ensure working well)

Copy link
Member

@imbajin imbajin Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another issue:

image

It seems unclear and unfriendly to report an error directly when the user does not carry the url scheme/prefix

Update: fixed in 89c4465

@imbajin imbajin changed the title replace ip and port with url refactor: replace the IP + Port with URL Apr 15, 2025
Comment on lines 46 to +47
try:
response = requests.get(
f"http://{self.ip}:{self.port}/versions", timeout=0.5
f"{self.url}/versions", timeout=0.5
Copy link
Member

@imbajin imbajin Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should add a compatibility check/adapter here.

If str does not start with http/https, it will automatically concatenate http:// to avoid making modifications at all original calls. 🤔 (It also avoids the risk of errors caused by omitted modifications)

Already fixed it

@imbajin imbajin requested a review from Copilot May 9, 2025 11:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request refactors multiple modules to replace separate IP and port parameters with a unified URL parameter, addressing issue #191. Key changes include updating configuration classes, client constructors, and example/test files to use "url" consistently, as well as modifying related API endpoints and configuration docs.

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
hugegraph-python-client/src/pyhugegraph/utils/huge_config.py Replaces ip/port with url and adds compatibility check for URL prefix
hugegraph-python-client/src/pyhugegraph/example/hugegraph_test.py Updates client initialization to use url instead of ip and port
hugegraph-python-client/src/pyhugegraph/client.py Updates PyHugeClient constructor to pass url to HGraphConfig
hugegraph-ml/* Systematically updates functions to receive url and pass to PyHugeClient
hugegraph-llm/* Modifies API endpoints, config modules and examples to adopt url replacement
hugegraph-llm/README.md Minor documentation update regarding poetry version

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 9, 2025
@imbajin imbajin merged commit 6754fae into apache:main May 9, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer llm ml python-client size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add HTTPS support

3 participants