Repository navigation
Weaviate update version - #25447
Weaviate update version#25447
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @DhruvGorasiya, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request modernizes the Weaviate vector database integration by upgrading to the latest Weaviate Python client (v4). The update involves a complete overhaul of the underlying adapter logic to leverage the new client's features and API, ensuring compatibility, improved performance, and a more intuitive interaction with Weaviate. It also includes new testing infrastructure and documentation to support the updated integration.
Highlights
- Weaviate Client Upgrade: The Weaviate Python client dependency has been updated from version
3.xto4.xto support the latest Weaviate API, bringing significant changes to how the client interacts with the Weaviate vector database. - Weaviate Adapter Refactoring: The core Weaviate vector database adapter (
weaviate_vector.py) has been extensively refactored to align with the new Weaviate v4 client API. This includes changes to client initialization, collection management, data insertion (using the new batch API andDataObject), and all search and deletion operations. - Enhanced Testing and Documentation: New files have been added to provide comprehensive testing and documentation for the Weaviate v4 integration. This includes a detailed smoke test guide (
README_SMOKE_TEST.md), a standalone smoke test script, and dedicated unit and integration tests to ensure the new implementation is robust and functional. - Docker Environment Update: A new
docker-compose.override.ymlfile has been introduced to ensure the correct Weaviate client version is installed within the Docker API service and to mount the updated Weaviate vector file, facilitating development and testing in a containerized environment.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request successfully updates the Weaviate integration to support the v4 Python client, which is a significant and necessary upgrade. The core logic has been refactored to use the new client API, and new tests and documentation have been added to support this change. My review focuses on a few critical areas to ensure correctness and robustness: a potential regression in how document IDs are generated, a flaw in the gRPC connection logic, and ensuring the new unit tests accurately reflect the implementation. Addressing these points will make the integration more reliable.
|
Hello, please resolve the conflicts. Most of the code LGTM. :) |
…viateUpdateVersion
|
@DhruvGorasiya @crazywoola
At the very least, there’s a side effect reported in #26938. |
|
Let me take a look at this and get back to you ASAP @kurokobo |
|
@DhruvGorasiya
That said, as a prerequisite, changing the Weaviate version should only be done after testing that migrating data from 1.19 to 1.27 can be done automatically without user intervention (I haven't tested this myself, so maybe I'm just worrying too much). |
|
@kurokobo Thanks for the detailed feedback! Yes, your understanding is correct, this was meant as a temporary workaround until the next Dify release. I’m currently working on fixing the issues you pointed out (override behavior, entrypoint usage, correct package install, and virtual environment handling) and will update the PR accordingly soon. |
Co-authored-by: crazywoola <427733928@qq.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: crazywoola <427733928@qq.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: crazywoola <427733928@qq.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This pull request updates the Weaviate client dependency to a newer major version and ensures compatibility in both the Python package configuration and the Docker development environment. The most important changes are as follows:
Dependency Updates:
weaviate-clientdependency inapi/pyproject.tomlfrom version~3.24.0to accept any4.x.xversion, ensuring compatibility with the latest Weaviate features and bug fixes.Development Environment Configuration:
docker/docker-compose.override.ymlto mount theweaviate_vector.pyfile as read-only into theapiservice and to explicitly install theweaviatepackage version>=4.0.0at container startup, ensuring the development environment matches the new dependency requirements.to support the latest Python client (Weaviate Integration)close feat: Weaviate supports Chinese bm25 #12223 #12258