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

Type conflict in json: param 'with_raw_data' ("True") should be a boolean #966

Open
yhmo opened this issue Nov 28, 2024 · 4 comments
Open

Comments

@yhmo
Copy link

yhmo commented Nov 28, 2024

Use this script to reproduce:

from pymilvus import (
    MilvusClient,
    DataType,
)

if __name__ == "__main__":
    client = MilvusClient(uri='http://localhost:19530')

    schema = client.create_schema(
        auto_id=False,
        enable_dynamic_schema=True,
    )

    schema.add_field(field_name="file_name", datatype=DataType.VARCHAR, max_length=100, is_primary=True)
    schema.add_field(field_name="vector", datatype=DataType.FLOAT_VECTOR, dim=6)
    schema.add_field(field_name="color", datatype=DataType.VARCHAR, max_length=100)

    index_params = client.prepare_index_params()
    index_params.add_index(field_name="vector", index_type="SCANN", metric_type="COSINE", params={'nlist': 512, 'with_raw_data': True})

    client.drop_collection(collection_name="test_ez2")
    client.create_collection(collection_name="test_ez2", schema=schema, index_params=index_params)

Throw an error:
<MilvusException: (code=1100, message=Type conflict in json: param 'with_raw_data' ("True") should be a boolean: invalid parameter[expected=valid index params][actual=invalid index params])>

If we set 'with_raw_data' = 'true', it works fine:
params={'nlist': 512, 'with_raw_data': 'true'}

'with_raw_data' = 'True' also throw this error:
params={'nlist': 512, 'with_raw_data': 'True'}

@yhmo
Copy link
Author

yhmo commented Nov 28, 2024

'with_raw_data': 'true' ---------------------------- no error
'with_raw_data': True ---------------------------- error
'with_raw_data': 'True' --------------------------- error

I suppose it should work for 'true', True and 'True'.

@yhmo
Copy link
Author

yhmo commented Nov 28, 2024

@chasingegg
Copy link
Collaborator

@yhmo what is the milvus version, it should work for 'true', True in latest knowhere, and it is the same behavior for all boolean type params

@yhmo
Copy link
Author

yhmo commented Nov 29, 2024

Milvus v2.5.0-beta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants