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.
Files changed (51) hide show
  1. redis/__init__.py +1 -1
  2. redis/_parsers/base.py +6 -0
  3. redis/_parsers/helpers.py +64 -6
  4. redis/asyncio/client.py +14 -5
  5. redis/asyncio/cluster.py +5 -1
  6. redis/asyncio/connection.py +19 -1
  7. redis/asyncio/http/__init__.py +0 -0
  8. redis/asyncio/http/http_client.py +265 -0
  9. redis/asyncio/multidb/__init__.py +0 -0
  10. redis/asyncio/multidb/client.py +530 -0
  11. redis/asyncio/multidb/command_executor.py +339 -0
  12. redis/asyncio/multidb/config.py +210 -0
  13. redis/asyncio/multidb/database.py +69 -0
  14. redis/asyncio/multidb/event.py +84 -0
  15. redis/asyncio/multidb/failover.py +125 -0
  16. redis/asyncio/multidb/failure_detector.py +38 -0
  17. redis/asyncio/multidb/healthcheck.py +285 -0
  18. redis/background.py +204 -0
  19. redis/client.py +49 -27
  20. redis/cluster.py +9 -1
  21. redis/commands/core.py +64 -29
  22. redis/commands/json/commands.py +2 -2
  23. redis/commands/search/__init__.py +2 -2
  24. redis/commands/search/aggregation.py +24 -26
  25. redis/commands/search/commands.py +10 -10
  26. redis/commands/search/field.py +2 -2
  27. redis/commands/search/query.py +12 -12
  28. redis/connection.py +1613 -1263
  29. redis/data_structure.py +81 -0
  30. redis/event.py +84 -10
  31. redis/exceptions.py +8 -0
  32. redis/http/__init__.py +0 -0
  33. redis/http/http_client.py +425 -0
  34. redis/maint_notifications.py +18 -7
  35. redis/multidb/__init__.py +0 -0
  36. redis/multidb/circuit.py +144 -0
  37. redis/multidb/client.py +526 -0
  38. redis/multidb/command_executor.py +350 -0
  39. redis/multidb/config.py +207 -0
  40. redis/multidb/database.py +130 -0
  41. redis/multidb/event.py +89 -0
  42. redis/multidb/exception.py +17 -0
  43. redis/multidb/failover.py +125 -0
  44. redis/multidb/failure_detector.py +104 -0
  45. redis/multidb/healthcheck.py +282 -0
  46. redis/retry.py +14 -1
  47. redis/utils.py +34 -0
  48. {redis-7.0.0b2.dist-info → redis-7.0.1.dist-info}/METADATA +17 -4
  49. {redis-7.0.0b2.dist-info → redis-7.0.1.dist-info}/RECORD +51 -25
  50. {redis-7.0.0b2.dist-info → redis-7.0.1.dist-info}/WHEEL +0 -0
  51. {redis-7.0.0b2.dist-info → redis-7.0.1.dist-info}/licenses/LICENSE +0 -0
@@ -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")
@@ -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[List[str]] = None
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
- ) -> None:
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: List[str]) -> "Query":
291
+ def limit_fields(self, *fields: str) -> "Query":
292
292
  """
293
293
  Limit the search to specific TEXT fields only.
294
294
 
295
- - **fields**: A list of strings; case-sensitive field names
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: List[str]) -> None:
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