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] Get interface returns empty when "ids" is a list of string for string primary key #2056

Open
1 task done
binbinlv opened this issue Apr 26, 2024 · 1 comment
Assignees
Labels
kind/bug Something isn't working

Comments

@binbinlv
Copy link

binbinlv commented Apr 26, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Get interface returns empty when "ids" is a list of string for string primary key

[2024-04-26 15:51:44 - DEBUG - ci_test]: (api_request)  : [MilvusClient.get] args: ['milvus_client_api_query_TIafVN0a', ['0'], None], kwargs: {'timeout': 120} (api_request.py:62)
[2024-04-26 15:51:44 - DEBUG - ci_test]: (api_response) : []  (api_request.py:37)

Expected Behavior

Return filtered entities successfully

Steps/Code To Reproduce behavior

@pytest.mark.tags(CaseLabel.L1)
    def test_milvus_client_get_normal_string(self):
        """
        target: test get interface for string field
        method: create connection, collection, insert delete, and search
        expected: search/query successfully without deleted data
        """
        client = self._connect(enable_milvus_client_api=True)
        collection_name = cf.gen_unique_str(prefix)
        # 1. create collection
        client_w.create_collection(client, collection_name, default_dim, id_type="string", max_length=ct.default_length)
        # 2. insert
        rng = np.random.default_rng(seed=19530)
        rows = [
            {default_primary_key_field_name: str(i), default_vector_field_name: list(rng.random((1, default_dim))[0]),
             default_float_field_name: i * 1.0, default_string_field_name: str(i)} for i in range(default_nb)]
        client_w.insert(client, collection_name, rows)[0]
        pks = [str(i) for i in range(default_nb)]
        log.debug(pks)
        # 3. get first primary key
        first_pk_data = client_w.get(client, collection_name, ids=pks[0:1])[0]
        assert len(first_pk_data) == len(pks[0:1])
        first_pk_data_1 = client_w.get(client, collection_name, ids="0")[0]
        assert first_pk_data == first_pk_data_1

        client_w.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): master latest
- pymilvus version: 2.5.0rc17
- Milvus configuration (Settings you made in `server_config.yaml`):

Anything else?

No response

@binbinlv binbinlv added the kind/bug Something isn't working label Apr 26, 2024
@binbinlv
Copy link
Author

/assign @czs007

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