From 66c23629cca718f4dc685d9a9efa31a207ea2442 Mon Sep 17 00:00:00 2001 From: lixinguo Date: Fri, 2 Aug 2024 15:20:47 +0800 Subject: [PATCH] fix: select a single column consisting of a list of column names Signed-off-by: lixinguo --- pymilvus/orm/schema.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pymilvus/orm/schema.py b/pymilvus/orm/schema.py index 3729a40bd..35d0d693f 100644 --- a/pymilvus/orm/schema.py +++ b/pymilvus/orm/schema.py @@ -510,7 +510,7 @@ def check_insert_schema(schema: CollectionSchema, data: Union[List[List], pd.Dat raise DataNotMatchException(message=msg) columns = list(data.columns) columns.remove(schema.primary_field) - data = data[[columns]] + data = data[columns] tmp_fields = copy.deepcopy(schema.fields) for i, field in enumerate(tmp_fields): @@ -528,7 +528,7 @@ def check_upsert_schema(schema: CollectionSchema, data: Union[List[List], pd.Dat if schema.primary_field.name not in data or data[schema.primary_field.name].isnull().all(): raise DataNotMatchException(message=ExceptionsMessage.UpsertPrimaryKeyEmpty) columns = list(data.columns) - data = data[[columns]] + data = data[columns] _check_data_schema_cnt(copy.deepcopy(schema.fields), data) _check_insert_data(data)