You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The get_compaction_plans() and get_compaction_state() interfaces cannot be used independently
testcases/test_collection_operations.py:1614 (TestCollectionMaintenance.test_collection_compact)
self = <test_collection_operations.TestCollectionMaintenance object at 0x1284695d0>
def test_collection_compact(self):
"""
target: test collection compact
method: create collection, insert data, flush multiple times, then compact
expected: compact successfully
"""
# Create collection
name = gen_collection_name()
client = self.collection_client
vector_client = self.vector_client
payload = {
"collectionName": name,
"schema": {
"fields": [
{"fieldName": "book_id", "dataType": "Int64", "isPrimary": True, "elementTypeParams": {}},
{"fieldName": "my_vector", "dataType": "FloatVector", "elementTypeParams": {"dim": 128}}
]
}
}
client.collection_create(payload)
# Insert and flush multiple times
for i in range(3):
# Insert data
vectors = [gen_vector(dim=128) for _ in range(10)]
insert_data = {
"collectionName": name,
"data": [
{
"book_id": i * 10 + j,
"my_vector": vector
}
for i, vector in enumerate(vectors)
for j in range(10)
]
}
response = vector_client.vector_insert(insert_data)
assert response["code"] == 0
# Flush after each insert
c = Collection(name)
c.flush()
# Compact collection
response = client.compact(name)
assert response["code"] == 0
# Get compaction state
response = client.get_compaction_state(name)
assert response["code"] == 0
assert "state" in response["data"]
assert "compactionID" in response["data"]
# verify by pymilvus
c = Collection(name)
> res = c.get_compaction_plans()
test_collection_operations.py:1669:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Collection>:
-------------
<name>: test_collection_2025_01_23_16_38_52_591233pzxRGbBb
<description>:
<schema>: {'aut...or', 'description': '', 'type': <DataType.FLOAT_VECTOR: 101>, 'params': {'dim': 128}}], 'enable_dynamic_field': False}
timeout = None, kwargs = {}
conn = <pymilvus.client.grpc_handler.GrpcHandler object at 0x12846b190>
def get_compaction_plans(self, timeout: Optional[float] = None, **kwargs) -> CompactionPlans:
"""Get the current compaction plans
Args:
timeout (``float``, optional): An optional duration of time in seconds to allow
for the RPC. When timeout is set to None, client waits until server response
or error occur.
Returns:
CompactionPlans: All the plans' states of this compaction.
"""
conn = self._get_connection()
> return conn.get_compaction_plans(self.compaction_id, timeout=timeout, **kwargs)
E AttributeError: 'Collection' object has no attribute 'compaction_id'
While verifying the compact restful API, I needed to use pymilvus's get_compaction_plans() and get_compaction_state() for auxiliary checks, but encountered errors. The compaction_id variable is set in the compact() method, and get_compaction_plans() and get_compaction_state() cannot be executed without first running this method.
Also, I think there might be a missing interface for listing compact job IDs. If you have executed multiple compactions, how can you view the information of previous compact IDs?
Expected Behavior
Add an interface for listing compact jobs, and add compact ID as an input parameter for get_compaction_plans() and get_compaction_state() methods.
Steps/Code To Reproduce behavior
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 configuration (Settings you made in `server_config.yaml`):
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Describe the bug
The get_compaction_plans() and get_compaction_state() interfaces cannot be used independently
While verifying the compact restful API, I needed to use pymilvus's get_compaction_plans() and get_compaction_state() for auxiliary checks, but encountered errors. The compaction_id variable is set in the compact() method, and get_compaction_plans() and get_compaction_state() cannot be executed without first running this method.
Also, I think there might be a missing interface for listing compact job IDs. If you have executed multiple compactions, how can you view the information of previous compact IDs?
Expected Behavior
Add an interface for listing compact jobs, and add compact ID as an input parameter for get_compaction_plans() and get_compaction_state() methods.
Steps/Code To Reproduce behavior
Environment details
Anything else?
No response
The text was updated successfully, but these errors were encountered: