Skip to content

Commit

Permalink
add judgement for isPrimary
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPresent-Han committed Oct 19, 2023
1 parent f52eefa commit 2c7f11a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions pymilvus/orm/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
RANGE_FILTER = "range_filter"
FIELDS = "fields"
EF = "ef"
IS_PRIMARY = "is_primary"
STOP_REDUCE_FOR_BEST = "stop_reduce_for_best"
DEFAULT_MAX_L2_DISTANCE = 99999999.0
DEFAULT_MIN_IP_DISTANCE = -99999999.0
Expand Down
5 changes: 3 additions & 2 deletions pymilvus/orm/iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
EF,
FIELDS,
INT64_MAX,
IS_PRIMARY,
MAX_BATCH_SIZE,
MAX_FILTERED_IDS_COUNT_ITERATION,
MAX_TRY_TIME,
Expand Down Expand Up @@ -163,7 +164,7 @@ def __check_reached_limit(self, ret: List):
def __setup__pk_prop(self):
fields = self._schema[FIELDS]
for field in fields:
if field["is_primary"]:
if field[IS_PRIMARY]:
if field["type"] == DataType.VARCHAR:
self._pk_str = True
else:
Expand Down Expand Up @@ -352,7 +353,7 @@ def __check_for_special_index_param(self):
def __setup__pk_prop(self):
fields = self._schema[FIELDS]
for field in fields:
if field["is_primary"]:
if IS_PRIMARY in field and field[IS_PRIMARY]:
if field["type"] == DataType.VARCHAR:
self._pk_str = True
else:
Expand Down

0 comments on commit 2c7f11a

Please sign in to comment.