Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(client): Implement new api & optimize code structure #63

Merged
merged 42 commits into from
Aug 13, 2024

Conversation

afterimagex
Copy link
Contributor

@afterimagex afterimagex commented Aug 12, 2024

  • Enhanced Naming Convention Support: Introduced support for underscore-named function calls in addition to existing camelCase naming convention. This allows for greater flexibility and compatibility with different coding styles and external libraries.

  • Expanded index_label Types: Augmented the index_label functionality by adding support for shard and unique types. These additional types provide enhanced indexing capabilities that enable more sophisticated data organization and retrieval scenarios, improving overall performance and scalability.

  • New Rank API Implementation: Implemented a new rank API to support ranking and sorting of data based on specified criteria. This feature enables applications to easily incorporate ranking logic into their workflows, enhancing user experience by presenting the most relevant or prioritized information first.

  • Optimized HTTP Invocation and Response Handling: Refactored HTTP client invocations to utilize a more streamlined approach. Introduced ResponseValidation for managing response checks, effectively reducing the need for explicit check_if_success calls in multiple locations. This optimization not only simplifies code but also enhances its maintainability and readability, making it easier to identify and resolve potential issues related to HTTP response handling.

TODO:

  • handle some py-lint problems before Merge to Master/Main

xupeichao and others added 22 commits August 6, 2024 20:36
…v3 support

This commit introduces significant updates to the hugegraph-python-client module, focusing on GraphSpace compatibility and API v3 support. Key changes include:

- Unified connection configuration via HGraphConfig to streamline parameter management.
- Enhanced HGraphSession for unified HTTP calls with optimized URL handling.
- Automatic GraphSpace detection based on server API version, ensuring compatibility with both old and new server versions.
- Refactored HGraphContext and HGraphRouter for more structured URL definitions using a decorator approach.
- Introduction of the @http decorator for simplified HTTP method and path definitions.
- Extensive compatibility testing to ensure a seamless experience across different server versions.

The update aims to provide a robust and flexible client module for interacting with HugeGraph servers, catering to the needs of both new and existing API versions.
TODO: replace it in the LLM module later
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Aug 12, 2024
@dosubot dosubot bot added the enhancement New feature or request label Aug 12, 2024
@imbajin imbajin requested review from imbajin and simon824 August 13, 2024 06:37
@@ -46,7 +48,7 @@ class CustomConsoleHandler(logging.StreamHandler):
"INFO": "\033[0;32m", # Green
"WARNING": "\033[0;33m", # Yellow
"ERROR": "\033[0;31m", # Red
"CRITICAL": "\033[0;41m" # Red background
"CRITICAL": "\033[0;41m", # Red background
Copy link
Member

Choose a reason for hiding this comment

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

Extra ,?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

black-formatter

Copy link
Member

Choose a reason for hiding this comment

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

black-formatter

OK, just keep it

hugegraph-python-client/README.md Show resolved Hide resolved
@@ -17,7 +17,7 @@ release soon
```python
from pyhugegraph.client import PyHugeClient

client = PyHugeClient("127.0.0.1", "8080", user="admin", pwd="admin", graph="hugegraph")
client = PyHugeClient("127.0.0.1", "8080", user="admin", pwd="admin", graph="hugegraph", gs="DEFAULT")
Copy link
Member

Choose a reason for hiding this comment

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

  • add a comment for this line (like gs is optional)
  • currently gs compatible with graphspace? (set as alias)

@imbajin imbajin added this to the 1.5.0 milestone Aug 13, 2024
@imbajin imbajin merged commit 752bd5f into apache:py-client-new Aug 13, 2024
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python-client size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants