Skip to content

Commit 9969ac0

Browse files
authored
fix: Remove not useful SequenceIterator (#2700)
See also: #2612 Signed-off-by: yangxuan <xuan.yang@zilliz.com>
1 parent 22489cf commit 9969ac0

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

pymilvus/client/abstract.py

+1-20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import abc
2-
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
2+
from typing import Any, Dict, List, Optional, Tuple, Union
33

44
import ujson
55

@@ -351,19 +351,6 @@ def _pack(self, raw: Any):
351351
)
352352

353353

354-
class SequenceIterator:
355-
def __init__(self, seq: Sequence[Any]):
356-
self._seq = seq
357-
self._idx = 0
358-
359-
def __next__(self) -> Any:
360-
if self._idx < len(self._seq):
361-
res = self._seq[self._idx]
362-
self._idx += 1
363-
return res
364-
raise StopIteration
365-
366-
367354
class BaseRanker:
368355
def __int__(self):
369356
return
@@ -653,9 +640,6 @@ def get_fields_by_range(
653640
continue
654641
return field2data
655642

656-
def __iter__(self) -> SequenceIterator:
657-
return SequenceIterator(self)
658-
659643
def __str__(self) -> str:
660644
"""Only print at most 10 query results"""
661645
reminder = f" ... and {len(self) - 10} results remaining" if len(self) > 10 else ""
@@ -735,9 +719,6 @@ def __init__(
735719

736720
super().__init__(hits)
737721

738-
def __iter__(self) -> SequenceIterator:
739-
return SequenceIterator(self)
740-
741722
def __str__(self) -> str:
742723
"""Only print at most 10 query results"""
743724
reminder = f" ... and {len(self) - 10} entities remaining" if len(self) > 10 else ""

0 commit comments

Comments
 (0)