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

[Bug]: [milvus_client_p2] Unexpected error to invalid reqs and ranker for interface hybrid_search #2588

Open
1 task done
binbinlv opened this issue Jan 22, 2025 · 2 comments
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@binbinlv
Copy link

binbinlv commented Jan 22, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Unexpected error to invalid reqs and ranker for interface hybrid_search

  1. hybrid search with invalid "reqs" , like non-list for "reqs", it reports:
(code=1, message=Unexpected error, message=<'int' object is not iterable>)>
  1. hybrid search with invalid "ranker" parameter, like "1" for "ranker", it reports:
code=1, message=Unexpected error, message=<'int' object has no attribute 'dict'>)

Expected Behavior

Invalid ...

Steps/Code To Reproduce behavior

    @pytest.mark.tags(CaseLabel.L1)
    @pytest.mark.parametrize("reqs", ["12-s", 1])
    def test_milvus_client_hybrid_search_invalid_reqs(self, reqs):
        """
        target: test hybrid search with inconsistent metric type (default is IP) with that of index
        method: create connection, collection, insert and search with not consistent metric type
        expected: Raise exception
        """
        client = self._client()
        collection_name = cf.gen_unique_str(prefix)
        # 1. create collection
        self.create_collection(client, collection_name, default_dim)
        # 2. hybrid search
        ranker = WeightedRanker(0.2, 0.8)
        error = {ct.err_code: 100,
                 ct.err_msg: f"collection not found[database=default][collection=1]"}
        self.hybrid_search(client, collection_name, reqs, ranker, limit=default_limit,
                    check_task=CheckTasks.err_res, check_items=error)
        self.drop_collection(client, collection_name)

    @pytest.mark.tags(CaseLabel.L1)
    @pytest.mark.parametrize("invalid_ranker", [1])
    def test_milvus_client_hybrid_search_invalid_ranker(self, invalid_ranker):
        """
        target: test hybrid search with inconsistent metric type (default is IP) with that of index
        method: create connection, collection, insert and search with not consistent metric type
        expected: Raise exception
        """
        client = self._client()
        collection_name = cf.gen_unique_str(prefix)
        # 1. create collection
        self.create_collection(client, collection_name, default_dim)
        # 2. hybrid search
        rng = np.random.default_rng(seed=19530)
        vectors_to_search = rng.random((1, 8))
        sub_search1 = AnnSearchRequest(vectors_to_search, "embeddings", {"level": 1}, 20, expr="id<100")
        ranker = WeightedRanker(0.2, 0.8)
        error = {ct.err_code: 100,
                 ct.err_msg: f"collection not found[database=default][collection=1]"}
        self.hybrid_search(client, collection_name, [sub_search1], invalid_ranker, limit=default_limit,
                    check_task=CheckTasks.err_res, check_items=error)
        self.drop_collection(client, collection_name)

Environment details

- Hardware/Softward conditions (OS, CPU, GPU, Memory):
- Method of installation (Docker, or from source):
- Milvus version (v0.3.1, or v0.4.0):  all
- Pymilvus version: 2.5.4rc1
- Milvus configuration (Settings you made in `server_config.yaml`):

Anything else?

No response

@binbinlv binbinlv added the kind/bug Something isn't working label Jan 22, 2025
@binbinlv
Copy link
Author

/assign @XuanYang-cn

@XuanYang-cn XuanYang-cn added this to the 2.4.15 milestone Jan 22, 2025
@binbinlv
Copy link
Author

And the same issue to the parameter "search_params" to search interface:

[2025-01-22 18:11:17 - ERROR - ci_test]: (api_response) : <MilvusException: (code=1, message=Unexpected error, message=<'str' object has no attribute 'get'>)> (api_request.py:36)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants