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): support graphspace & refactor all APIs #67

Merged
merged 5 commits into from
Aug 15, 2024
Merged

Conversation

imbajin
Copy link
Member

@imbajin imbajin commented Aug 14, 2024

Now we refactor the whole py-client module, and ALSO we keep the compatible with the legacy request url~

This PR introduces significant updates to the hugegraph-python-client module, focusing on GraphSpace compatibility and API v3 support. Key changes include: (Already tested for some days)

  • 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.

Note: Merge the 4 commits to master (Don't squash it to one commit)

imbajin and others added 5 commits August 7, 2024 19:05
Also we keep the compatible with the legacy request url/uri~

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

- [x] Unified connection configuration via HGraphConfig to streamline parameter management.
- [x] Enhanced HGraphSession for unified HTTP calls with optimized URL handling.
- [x] Automatic GraphSpace detection based on server API version, ensuring compatibility with both old and new server versions.
- [x] Refactored HGraphContext and HGraphRouter for more structured URL definitions using a decorator approach.
- [x] 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.

---------

Co-authored-by: imbajin <[email protected]>
- 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

---------

Co-authored-by: imbajin <[email protected]>
Co-authored-by: blank <[email protected]>
merge to master now
---------

Co-authored-by: imbajin <[email protected]>
Co-authored-by: blank <[email protected]>
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Aug 14, 2024
@dosubot dosubot bot added the enhancement New feature or request label Aug 14, 2024
@imbajin imbajin merged commit 0a9bf24 into main Aug 15, 2024
11 checks passed
@imbajin imbajin deleted the py-client-new branch August 15, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request llm 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.

3 participants