Skip to content

Commit

Permalink
Mypy compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
coady committed Oct 17, 2024
1 parent f7cc6f6 commit 2c50c3b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lupyne/engine/indexers.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def spans(self, query: spans.SpanQuery, positions=False) -> Iterator[tuple]:
yield (doc + offset), values
offset += reader.maxDoc()

def parse(self, query, spellcheck=False, **kwargs):
def parse(self, query, spellcheck=False, **kwargs) -> search.Query:
if isinstance(query, search.Query):
return query
if spellcheck:
Expand All @@ -394,8 +394,7 @@ def count(self, *query, **options) -> int:
"""
if len(query) > 1:
return self.docFreq(index.Term(*query))
query = self.parse(*query, **options) if query else Query.alldocs()
return super().count(query)
return super().count(self.parse(*query, **options) if query else Query.alldocs())

def collector(self, count=None, sort=None, reverse=False, scores=False, mincount=1000):
if count is None:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ graphql = ["strawberry-graphql[asgi]>=0.221"]

[tool.ruff]
line-length = 100
extend-include = ["*.ipynb"]

[tool.ruff.format]
quote-style = "preserve"
Expand Down

0 comments on commit 2c50c3b

Please sign in to comment.