Skip to content

[Bug]: [milvus_client]Unexpected error for create_database and list_databases when using an incorrect parameter format #2594

@laurazhao0611

Description

@laurazhao0611

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Unexpected error for create_database and list_databases when using an incorrect parameter format.

  1. create_database with invalid properties, eg: create_database(db_name, "hh")
    Unexpected error, message=<unsupported operand type(s) for +: 'float' and 'str'>
  2. list_databases with param, eg: list_databases("default)
    Unexpected error, message=<unsupported operand type(s) for +: 'float' and 'str'>

Expected Behavior

No response

Steps/Code To Reproduce behavior

@pytest.mark.tags(CaseLabel.L1)
    @pytest.mark.parametrize("properties", ["hhh", []])
    def test_milvus_client_create_database_with_invalid_properties(self, properties):
        """
        target: test fast create db name with invalid properties
        method: create db name with invalid properties
        expected: raise exception
        actual: Currently such errors are not very readable, 
                and entries of numeric types such as 1.11, 111 are not blocked
        """
        client = self._client()
        # 1. create database
        db_name = cf.gen_unique_str(db_prefix)
        error = {ct.err_code: 1, ct.err_msg: f"Unexpected error, message=<unsupported operand type(s) for +: 'float' and '{type(properties).__name__}'>"}
        self.create_database(client, db_name, properties,
                               check_task=CheckTasks.err_res, check_items=error)
@pytest.mark.tags(CaseLabel.L2)
    @pytest.mark.parametrize("db_name", ["default"])
    def test_milvus_client_list_databases_with_params(self, db_name):
        """
        target: test list database with params
        method: list database with params
        expected: raise exception
        """
        client = self._client()
        error = {ct.err_code: 1, ct.err_msg: f"Unexpected error, message=<unsupported operand type(s) for +: 'float' and 'str'>"}
        self.list_databases(client, db_name,
                            check_task=CheckTasks.err_res, check_items=error)

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.6.0rc60
- Milvus configuration (Settings you made in `server_config.yaml`):

Anything else?

No response

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions