Skip to content

Comments

enhance: [cp26]apply coding style to test file (#3220)#3221

Merged
sre-ci-robot merged 1 commit intomilvus-io:2.6from
XuanYang-cn:cp-lint-test
Jan 22, 2026
Merged

enhance: [cp26]apply coding style to test file (#3220)#3221
sre-ci-robot merged 1 commit intomilvus-io:2.6from
XuanYang-cn:cp-lint-test

Conversation

@XuanYang-cn
Copy link
Contributor

No description provided.

@sre-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: XuanYang-cn

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (2.6@eb0388b). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pymilvus/client/prepare.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##             2.6    #3221   +/-   ##
======================================
  Coverage       ?   44.63%           
======================================
  Files          ?       67           
  Lines          ?    14358           
  Branches       ?        0           
======================================
  Hits           ?     6409           
  Misses         ?     7949           
  Partials       ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gemini-code-assist
Copy link

Summary of Changes

Hello @XuanYang-cn, 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 focuses on a comprehensive enhancement of the test suite's code quality and maintainability. It systematically applies a consistent coding style across all test files and undertakes a significant restructuring of gRPC handler-related tests. Additionally, it introduces more robust validation mechanisms for upsert operations, ensuring greater data integrity and refining the specificity of exception handling within the tests.

Highlights

  • Coding Style Enforcement: Extended linting and formatting tools (Black and Ruff) to cover all test files by updating the Makefile, ensuring consistent code style across the entire test suite.
  • Test Suite Refactoring: Performed significant refactoring and cleanup of gRPC handler tests, leading to the removal of tests/test_grpc_handler.py and substantial modifications to tests/test_grpc_handler_mutations.py. This indicates a broader reorganization of how these functionalities are tested.
  • Enhanced Upsert Validation: Improved validation logic for upsert operations in pymilvus/client/prepare.py, specifically addressing the partial_update parameter, handling of missing fields, and ensuring data length consistency. New tests were added to cover these scenarios.
  • Specific Exception Handling in Tests: Replaced generic pytest.raises(MilvusException) with more specific exception types like pytest.raises(ParamError) or pytest.raises(DataNotMatchException) in several test files, enhancing the precision and robustness of error testing.
  • Vector Data Flushing during Partial Updates: Added a new test case to verify that cached vector types, such as float16_vector, are correctly flushed when performing partial updates.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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

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

@mergify mergify bot added the ci-passed label Jan 22, 2026
@XuanYang-cn
Copy link
Contributor Author

/assign @jac0626
Please help review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request applies coding style changes across many test files, which is a good step towards improving code consistency. However, I have a major concern regarding the test coverage. The file tests/test_grpc_handler.py has been removed, and the file tests/test_grpc_handler_mutations.py has been drastically reduced in size, resulting in the removal of many test classes and test cases (e.g., TestGrpcHandlerInsertOperations, TestGrpcHandlerDeleteAndUpsertOperations, TestGrpcHandlerSearchOperations). This appears to be a significant loss of test coverage for GrpcHandler. Could you please clarify if this was intentional and if these tests are covered elsewhere? Restoring the deleted tests is highly recommended to maintain code quality and prevent regressions.

I've also found a critical issue in tests/test_decorators.py where an exception class is raised instead of an instance, which will cause a TypeError. Additionally, I have a suggestion to rename tests/test_grpc_handler_mutations.py to better reflect its content. Please see the detailed comments.

@jac0626
Copy link
Collaborator

jac0626 commented Jan 22, 2026

/lgtm

@sre-ci-robot sre-ci-robot merged commit d44cea5 into milvus-io:2.6 Jan 22, 2026
13 checks passed
@XuanYang-cn XuanYang-cn deleted the cp-lint-test branch January 22, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants