Skip to content

Commit 2852618

Browse files
committed
Remove unnecessary invoke of describe_collection()
Signed-off-by: yhmo <[email protected]>
1 parent b490a0a commit 2852618

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

pymilvus/milvus_client/milvus_client.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -453,20 +453,17 @@ def query(
453453
ids = [ids]
454454

455455
conn = self._get_connection()
456-
try:
457-
schema_dict = conn.describe_collection(collection_name, timeout=timeout, **kwargs)
458-
except Exception as ex:
459-
logger.error("Failed to describe collection: %s", collection_name)
460-
raise ex from ex
461456

462457
if ids:
458+
try:
459+
schema_dict = conn.describe_collection(collection_name, timeout=timeout, **kwargs)
460+
except Exception as ex:
461+
logger.error("Failed to describe collection: %s", collection_name)
462+
raise ex from ex
463463
filter = self._pack_pks_expr(schema_dict, ids)
464464

465465
if not output_fields:
466466
output_fields = ["*"]
467-
vec_field_name = self._get_vector_field_name(schema_dict)
468-
if vec_field_name:
469-
output_fields.append(vec_field_name)
470467

471468
try:
472469
res = conn.query(

0 commit comments

Comments
 (0)