Skip to content

Commit e374268

Browse files
authored
Update to redis 4.1.4 (#7247)
Closes: #7245
1 parent 4a0dabd commit e374268

File tree

4 files changed

+66
-3
lines changed

4 files changed

+66
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
redis.client.Pipeline.transaction # instance attribute has same name as superclass method
2+
redis.commands.search.commands.SearchCommands.explain # https://github.com/redis/redis-py/pull/1997
23
redis.ocsp # requires cryptography to be installed

stubs/redis/redis/commands/search/commands.pyi

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
from collections.abc import Mapping
12
from typing import Any
23
from typing_extensions import Literal
34

5+
from .aggregation import AggregateRequest, AggregateResult, Cursor
6+
from .query import Query
7+
from .result import Result
8+
9+
_QueryParams = Mapping[str, str | float]
10+
411
NUMERIC: Literal["NUMERIC"]
512

613
CREATE_CMD: Literal["FT.CREATE"]
@@ -75,10 +82,11 @@ class SearchCommands:
7582
def load_document(self, id): ...
7683
def get(self, *ids): ...
7784
def info(self): ...
78-
def search(self, query): ...
79-
def explain(self, query): ...
85+
def get_params_args(self, query_params: _QueryParams) -> list[Any]: ...
86+
def search(self, query: str | Query, query_params: _QueryParams | None = ...) -> Result: ...
87+
def explain(self, query: str | Query, query_params: _QueryParams | None = ...): ...
8088
def explain_cli(self, query): ...
81-
def aggregate(self, query): ...
89+
def aggregate(self, query: AggregateRequest | Cursor, query_params: _QueryParams | None = ...) -> AggregateResult: ...
8290
def profile(self, query, limited: bool = ...): ...
8391
def spellcheck(self, query, distance: Any | None = ..., include: Any | None = ..., exclude: Any | None = ...): ...
8492
def dict_add(self, name, *terms): ...
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
from typing import Any
2+
3+
class Query:
4+
def __init__(self, query_string) -> None: ...
5+
def query_string(self): ...
6+
def limit_ids(self, *ids): ...
7+
def return_fields(self, *fields): ...
8+
def return_field(self, field, as_field: Any | None = ...): ...
9+
def summarize(
10+
self, fields: Any | None = ..., context_len: Any | None = ..., num_frags: Any | None = ..., sep: Any | None = ...
11+
): ...
12+
def highlight(self, fields: Any | None = ..., tags: Any | None = ...): ...
13+
def language(self, language): ...
14+
def slop(self, slop): ...
15+
def in_order(self): ...
16+
def scorer(self, scorer): ...
17+
def get_args(self): ...
18+
def paging(self, offset, num): ...
19+
def verbatim(self): ...
20+
def no_content(self): ...
21+
def no_stopwords(self): ...
22+
def with_payloads(self): ...
23+
def with_scores(self): ...
24+
def limit_fields(self, *fields): ...
25+
def add_filter(self, flt): ...
26+
def sort_by(self, field, asc: bool = ...): ...
27+
def expander(self, expander): ...
28+
29+
class Filter:
30+
args: Any
31+
def __init__(self, keyword, field, *args) -> None: ...
32+
33+
class NumericFilter(Filter):
34+
INF: str
35+
NEG_INF: str
36+
def __init__(self, field, minval, maxval, minExclusive: bool = ..., maxExclusive: bool = ...) -> None: ...
37+
38+
class GeoFilter(Filter):
39+
METERS: str
40+
KILOMETERS: str
41+
FEET: str
42+
MILES: str
43+
def __init__(self, field, lon, lat, radius, unit=...) -> None: ...
44+
45+
class SortbyField:
46+
args: Any
47+
def __init__(self, field, asc: bool = ...) -> None: ...
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from typing import Any
2+
3+
class Result:
4+
total: Any
5+
duration: Any
6+
docs: Any
7+
def __init__(self, res, hascontent, duration: int = ..., has_payload: bool = ..., with_scores: bool = ...) -> None: ...

0 commit comments

Comments
 (0)