Skip to content

[Bug]: call Collection(collection_name, using=alias) error : weakly-referenced object no longer exists #2567

@bxgong

Description

@bxgong

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

when I call Collection(collection_name, using=alias) , this collection contains auto bm25 function fields,
met the following exception :

during : Function.construct_from_dict(function_raw)
input_field_names = (
[input_field_names] if isinstance(input_field_names, str) else input_field_names
)
the input_field_names and output_field_names in function_raw is not str, the type is : <class 'google.protobuf.internal.containers.RepeatedScalarFieldContainer'>

this lead to the following error: copy.deepcopy(function)

File "###\Python311\Lib\site-packages\pymilvus\orm\collection.py", line 127, in init
server_schema = CollectionSchema.construct_from_dict(resp)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "###\Python311\Lib\site-packages\pymilvus\orm\schema.py", line 257, in construct_from_dict
return CollectionSchema(
^^^^^^^^^^^^^^^^^
File "###\Python311\Lib\site-packages\pymilvus\orm\schema.py", line 111, in init
self._functions = [copy.deepcopy(function) for function in functions]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "###\Python311\Lib\site-packages\pymilvus\orm\schema.py", line 111, in
self._functions = [copy.deepcopy(function) for function in functions]
^^^^^^^^^^^^^^^^^^^^^^^
File "###\Python311\Lib\copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "###\Python311\Lib\copy.py", line 271, in _reconstruct
state = deepcopy(state, memo)
^^^^^^^^^^^^^^^^^^^^^
File "###\Python311\Lib\copy.py", line 146, in deepcopy
y = copier(x, memo)
^^^^^^^^^^^^^^^
File "###\Python311\Lib\copy.py", line 231, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
^^^^^^^^^^^^^^^^^^^^^
File "###\Python311\Lib\copy.py", line 153, in deepcopy
y = copier(memo)

Expected Behavior

in Collection(collection_name, using=alias) ,
resp = conn.describe_collection(self._name, **kwargs)
the "functions" field in resp seems have not convert to 'google.protobuf.internal.containers.RepeatedScalarFieldContainer' object to simple str list

Steps/Code To Reproduce behavior

create a collection which contains bm25 function field(prepare for use Full Text Search),
then use  Collection(collection_name, using=alias)  to get the handler of this collection

Environment details

- Method of installation (Docker):
- Milvus version (v2.5.1):
- pymilvus version 2.5.1

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