Skip to content

Commit

Permalink
fix wrong expr handling due to and/or priorities(#2113) (#2115)
Browse files Browse the repository at this point in the history
Signed-off-by: MrPresent-Han <[email protected]>
Co-authored-by: MrPresent-Han <[email protected]>
  • Loading branch information
MrPresent-Han and MrPresent-Han authored Jun 5, 2024
1 parent 58957ae commit e48cd20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pymilvus/orm/iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def __setup_next_expr(self) -> None:
filtered_pk_str = f"{self._pk_field_name} > {self._next_id}"
if current_expr is None or len(current_expr) == 0:
return filtered_pk_str
return current_expr + " and " + filtered_pk_str
return "(" + current_expr + ")" + " and " + filtered_pk_str

def __update_cursor(self, res: List) -> None:
if len(res) == 0:
Expand Down Expand Up @@ -572,7 +572,7 @@ def __filtered_duplicated_result_expr(self, expr: str):
if len(filtered_ids_str) > 0:
if expr is not None and len(expr) > 0:
filter_expr = f" and {self._pk_field_name} not in [{filtered_ids_str}]"
return expr + filter_expr
return "(" + expr + ")" + filter_expr
return f"{self._pk_field_name} not in [{filtered_ids_str}]"
return expr

Expand Down

0 comments on commit e48cd20

Please sign in to comment.