milvus-io / pymilvus

Python SDK for Milvus.
Apache License 2.0
1.02k stars 324 forks source link

[Bug]: AttributeError: 'MilvusClient' object has no attribute 'num_partitions' #1506

Open Chiiizzzy opened 1 year ago

Chiiizzzy commented 1 year ago

Is there an existing issue for this?

Describe the bug

When I insert data into a collection, MilvusClient reports AttributeError: 'MilvusClient' object has no attribute 'num_partitions' So I look into the source code and found num_partitions is not defined in MilvusClient

截屏2023-06-01 11 05 18

Here in _create_collection is the only function mentions num_partitons . And I commented out num_partitions=self.num_partitions,, It worked.

Expected Behavior

Insert the data into the collection.

Steps/Code To Reproduce behavior

from pymilvus import MilvusClient
import numpy as np

collection_name = 'test'
client = MilvusClient(collection_name, vector_field='emb', overwrite=True)

datas = []
count = 10
for cur in range(count):
    temp = {
        "emb": np.random.rand(384)
    }
    datas.append(temp)
client.insert_data(datas)
print(client.num_entities())

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): Milvus: 2.3.0beta1/Pymilvus: 2.4.0dev38
- Milvus configuration (Settings you made in `server_config.yaml`):

Anything else?

No response

im-ajaymeena commented 1 year ago

/assign

XuanYang-cn commented 1 year ago

/assign