redis 7.0.0b2__py3-none-any.whl → 7.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- redis/__init__.py +1 -1
- redis/_parsers/base.py +6 -0
- redis/_parsers/helpers.py +64 -6
- redis/asyncio/client.py +14 -5
- redis/asyncio/cluster.py +5 -1
- redis/asyncio/connection.py +19 -1
- redis/asyncio/http/__init__.py +0 -0
- redis/asyncio/http/http_client.py +265 -0
- redis/asyncio/multidb/__init__.py +0 -0
- redis/asyncio/multidb/client.py +530 -0
- redis/asyncio/multidb/command_executor.py +339 -0
- redis/asyncio/multidb/config.py +210 -0
- redis/asyncio/multidb/database.py +69 -0
- redis/asyncio/multidb/event.py +84 -0
- redis/asyncio/multidb/failover.py +125 -0
- redis/asyncio/multidb/failure_detector.py +38 -0
- redis/asyncio/multidb/healthcheck.py +285 -0
- redis/background.py +204 -0
- redis/client.py +49 -27
- redis/cluster.py +9 -1
- redis/commands/core.py +64 -29
- redis/commands/json/commands.py +2 -2
- redis/commands/search/__init__.py +2 -2
- redis/commands/search/aggregation.py +24 -26
- redis/commands/search/commands.py +10 -10
- redis/commands/search/field.py +2 -2
- redis/commands/search/query.py +12 -12
- redis/connection.py +1613 -1263
- redis/data_structure.py +81 -0
- redis/event.py +84 -10
- redis/exceptions.py +8 -0
- redis/http/__init__.py +0 -0
- redis/http/http_client.py +425 -0
- redis/maint_notifications.py +18 -7
- redis/multidb/__init__.py +0 -0
- redis/multidb/circuit.py +144 -0
- redis/multidb/client.py +526 -0
- redis/multidb/command_executor.py +350 -0
- redis/multidb/config.py +207 -0
- redis/multidb/database.py +130 -0
- redis/multidb/event.py +89 -0
- redis/multidb/exception.py +17 -0
- redis/multidb/failover.py +125 -0
- redis/multidb/failure_detector.py +104 -0
- redis/multidb/healthcheck.py +282 -0
- redis/retry.py +14 -1
- redis/utils.py +34 -0
- {redis-7.0.0b2.dist-info → redis-7.0.1.dist-info}/METADATA +17 -4
- {redis-7.0.0b2.dist-info → redis-7.0.1.dist-info}/RECORD +51 -25
- {redis-7.0.0b2.dist-info → redis-7.0.1.dist-info}/WHEEL +0 -0
- {redis-7.0.0b2.dist-info → redis-7.0.1.dist-info}/licenses/LICENSE +0 -0
redis/commands/search/field.py
CHANGED
|
@@ -52,14 +52,14 @@ class Field:
|
|
|
52
52
|
self.args_suffix = list()
|
|
53
53
|
self.as_name = as_name
|
|
54
54
|
|
|
55
|
-
if sortable:
|
|
56
|
-
self.args_suffix.append(Field.SORTABLE)
|
|
57
55
|
if no_index:
|
|
58
56
|
self.args_suffix.append(Field.NOINDEX)
|
|
59
57
|
if index_missing:
|
|
60
58
|
self.args_suffix.append(Field.INDEX_MISSING)
|
|
61
59
|
if index_empty:
|
|
62
60
|
self.args_suffix.append(Field.INDEX_EMPTY)
|
|
61
|
+
if sortable:
|
|
62
|
+
self.args_suffix.append(Field.SORTABLE)
|
|
63
63
|
|
|
64
64
|
if no_index and not sortable:
|
|
65
65
|
raise ValueError("Non-Sortable non-Indexable fields are ignored")
|
redis/commands/search/query.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import List, Optional, Union
|
|
1
|
+
from typing import List, Optional, Tuple, Union
|
|
2
2
|
|
|
3
3
|
from redis.commands.search.dialect import DEFAULT_DIALECT
|
|
4
4
|
|
|
@@ -31,7 +31,7 @@ class Query:
|
|
|
31
31
|
self._with_scores: bool = False
|
|
32
32
|
self._scorer: Optional[str] = None
|
|
33
33
|
self._filters: List = list()
|
|
34
|
-
self._ids: Optional[
|
|
34
|
+
self._ids: Optional[Tuple[str, ...]] = None
|
|
35
35
|
self._slop: int = -1
|
|
36
36
|
self._timeout: Optional[float] = None
|
|
37
37
|
self._in_order: bool = False
|
|
@@ -81,7 +81,7 @@ class Query:
|
|
|
81
81
|
self._return_fields += ("AS", as_field)
|
|
82
82
|
return self
|
|
83
83
|
|
|
84
|
-
def _mk_field_list(self, fields: List[str]) -> List:
|
|
84
|
+
def _mk_field_list(self, fields: Optional[Union[List[str], str]]) -> List:
|
|
85
85
|
if not fields:
|
|
86
86
|
return []
|
|
87
87
|
return [fields] if isinstance(fields, str) else list(fields)
|
|
@@ -126,7 +126,7 @@ class Query:
|
|
|
126
126
|
|
|
127
127
|
def highlight(
|
|
128
128
|
self, fields: Optional[List[str]] = None, tags: Optional[List[str]] = None
|
|
129
|
-
) ->
|
|
129
|
+
) -> "Query":
|
|
130
130
|
"""
|
|
131
131
|
Apply specified markup to matched term(s) within the returned field(s).
|
|
132
132
|
|
|
@@ -187,16 +187,16 @@ class Query:
|
|
|
187
187
|
self._scorer = scorer
|
|
188
188
|
return self
|
|
189
189
|
|
|
190
|
-
def get_args(self) -> List[str]:
|
|
190
|
+
def get_args(self) -> List[Union[str, int, float]]:
|
|
191
191
|
"""Format the redis arguments for this query and return them."""
|
|
192
|
-
args = [self._query_string]
|
|
192
|
+
args: List[Union[str, int, float]] = [self._query_string]
|
|
193
193
|
args += self._get_args_tags()
|
|
194
194
|
args += self._summarize_fields + self._highlight_fields
|
|
195
195
|
args += ["LIMIT", self._offset, self._num]
|
|
196
196
|
return args
|
|
197
197
|
|
|
198
|
-
def _get_args_tags(self) -> List[str]:
|
|
199
|
-
args = []
|
|
198
|
+
def _get_args_tags(self) -> List[Union[str, int, float]]:
|
|
199
|
+
args: List[Union[str, int, float]] = []
|
|
200
200
|
if self._no_content:
|
|
201
201
|
args.append("NOCONTENT")
|
|
202
202
|
if self._fields:
|
|
@@ -288,14 +288,14 @@ class Query:
|
|
|
288
288
|
self._with_scores = True
|
|
289
289
|
return self
|
|
290
290
|
|
|
291
|
-
def limit_fields(self, *fields:
|
|
291
|
+
def limit_fields(self, *fields: str) -> "Query":
|
|
292
292
|
"""
|
|
293
293
|
Limit the search to specific TEXT fields only.
|
|
294
294
|
|
|
295
|
-
- **fields**:
|
|
295
|
+
- **fields**: Each element should be a string, case sensitive field name
|
|
296
296
|
from the defined schema.
|
|
297
297
|
"""
|
|
298
|
-
self._fields = fields
|
|
298
|
+
self._fields = list(fields)
|
|
299
299
|
return self
|
|
300
300
|
|
|
301
301
|
def add_filter(self, flt: "Filter") -> "Query":
|
|
@@ -340,7 +340,7 @@ class Query:
|
|
|
340
340
|
|
|
341
341
|
|
|
342
342
|
class Filter:
|
|
343
|
-
def __init__(self, keyword: str, field: str, *args:
|
|
343
|
+
def __init__(self, keyword: str, field: str, *args: Union[str, float]) -> None:
|
|
344
344
|
self.args = [keyword, field] + list(args)
|
|
345
345
|
|
|
346
346
|
|