33import datetime
44import operator
55from collections .abc import Callable , Iterator , Sequence
6- from typing import Self
6+ from typing import Self , no_type_check
77
88import lucene
99from java .lang import Long
@@ -104,6 +104,7 @@ def settings(self) -> dict:
104104 result [name ] = value if isinstance (value , int ) else str (value )
105105 return result
106106
107+ @no_type_check
107108 def items (self , * values ) -> Iterator [document .Field ]:
108109 """Generate lucene Fields suitable for adding to a document."""
109110 if self .docvalues :
@@ -404,6 +405,7 @@ def docvalues(self, field: str, type=None) -> dict:
404405 """Return mapping of docs to docvalues."""
405406 return self .searcher .docvalues (field , type ).select (self .ids )
406407
408+ @no_type_check
407409 def groupby (
408410 self , func : Callable , count : int | None = None , docs : int | None = None
409411 ) -> "Groups" :
@@ -418,9 +420,9 @@ def groupby(
418420 group = groups [value ]
419421 except KeyError :
420422 group = groups [value ] = type (self )(self .searcher , [], fields = self .fields )
421- group .value = value # type: ignore
423+ group .value = value
422424 group .scoredocs .append (scoredoc )
423- groups = list (groups .values ()) # type: ignore
425+ groups = list (groups .values ())
424426 for group in groups :
425427 group .count = len (group )
426428 group .scoredocs = group .scoredocs [:docs ]
0 commit comments