coredis 4.24.0__py3-none-any.whl → 5.0.0rc1__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.
Potentially problematic release.
This version of coredis might be problematic. Click here for more details.
- coredis/__init__.py +1 -3
- coredis/_packer.py +10 -10
- coredis/_protocols.py +23 -32
- coredis/_py_311_typing.py +20 -0
- coredis/_py_312_typing.py +17 -0
- coredis/_utils.py +49 -51
- coredis/_version.py +3 -3
- coredis/cache.py +57 -82
- coredis/client/__init__.py +1 -2
- coredis/client/basic.py +129 -56
- coredis/client/cluster.py +147 -70
- coredis/commands/__init__.py +27 -7
- coredis/commands/_key_spec.py +11 -10
- coredis/commands/_utils.py +1 -1
- coredis/commands/_validators.py +30 -20
- coredis/commands/_wrappers.py +19 -99
- coredis/commands/bitfield.py +10 -2
- coredis/commands/constants.py +20 -3
- coredis/commands/core.py +1627 -1246
- coredis/commands/function.py +21 -19
- coredis/commands/monitor.py +0 -71
- coredis/commands/pubsub.py +7 -142
- coredis/commands/request.py +108 -0
- coredis/commands/script.py +9 -9
- coredis/commands/sentinel.py +60 -49
- coredis/connection.py +14 -15
- coredis/exceptions.py +2 -2
- coredis/experimental/__init__.py +0 -4
- coredis/globals.py +3 -0
- coredis/modules/autocomplete.py +28 -30
- coredis/modules/base.py +15 -31
- coredis/modules/filters.py +269 -245
- coredis/modules/graph.py +61 -62
- coredis/modules/json.py +172 -140
- coredis/modules/response/_callbacks/autocomplete.py +5 -4
- coredis/modules/response/_callbacks/graph.py +34 -29
- coredis/modules/response/_callbacks/json.py +5 -3
- coredis/modules/response/_callbacks/search.py +49 -53
- coredis/modules/response/_callbacks/timeseries.py +18 -30
- coredis/modules/response/types.py +1 -5
- coredis/modules/search.py +186 -169
- coredis/modules/timeseries.py +184 -164
- coredis/parser.py +6 -19
- coredis/pipeline.py +391 -422
- coredis/pool/basic.py +7 -7
- coredis/pool/cluster.py +3 -3
- coredis/pool/nodemanager.py +10 -3
- coredis/response/_callbacks/__init__.py +76 -57
- coredis/response/_callbacks/acl.py +0 -3
- coredis/response/_callbacks/cluster.py +25 -16
- coredis/response/_callbacks/command.py +8 -6
- coredis/response/_callbacks/connection.py +4 -3
- coredis/response/_callbacks/geo.py +17 -13
- coredis/response/_callbacks/hash.py +13 -11
- coredis/response/_callbacks/keys.py +9 -5
- coredis/response/_callbacks/module.py +2 -3
- coredis/response/_callbacks/script.py +6 -8
- coredis/response/_callbacks/sentinel.py +21 -17
- coredis/response/_callbacks/server.py +36 -14
- coredis/response/_callbacks/sets.py +3 -4
- coredis/response/_callbacks/sorted_set.py +27 -24
- coredis/response/_callbacks/streams.py +22 -13
- coredis/response/_callbacks/strings.py +7 -6
- coredis/response/_callbacks/vector_sets.py +126 -0
- coredis/response/types.py +13 -4
- coredis/sentinel.py +1 -1
- coredis/stream.py +4 -3
- coredis/tokens.py +343 -16
- coredis/typing.py +432 -79
- {coredis-4.24.0.dist-info → coredis-5.0.0rc1.dist-info}/METADATA +4 -5
- coredis-5.0.0rc1.dist-info/RECORD +95 -0
- coredis/client/keydb.py +0 -336
- coredis/pipeline.pyi +0 -2103
- coredis-4.24.0.dist-info/RECORD +0 -93
- {coredis-4.24.0.dist-info → coredis-5.0.0rc1.dist-info}/WHEEL +0 -0
- {coredis-4.24.0.dist-info → coredis-5.0.0rc1.dist-info}/licenses/LICENSE +0 -0
- {coredis-4.24.0.dist-info → coredis-5.0.0rc1.dist-info}/top_level.txt +0 -0
coredis/parser.py
CHANGED
|
@@ -53,7 +53,7 @@ NOT_ENOUGH_DATA: Final[NotEnoughData] = NotEnoughData()
|
|
|
53
53
|
class RESPNode:
|
|
54
54
|
__slots__ = ("depth", "key", "node_type")
|
|
55
55
|
depth: int
|
|
56
|
-
key:
|
|
56
|
+
key: Hashable
|
|
57
57
|
node_type: int
|
|
58
58
|
|
|
59
59
|
def __init__(
|
|
@@ -96,22 +96,16 @@ class ListNode(RESPNode):
|
|
|
96
96
|
|
|
97
97
|
|
|
98
98
|
class DictNode(RESPNode):
|
|
99
|
-
__slots__ = ("container",)
|
|
99
|
+
__slots__ = ("container", "key")
|
|
100
100
|
|
|
101
101
|
def __init__(self, depth: int) -> None:
|
|
102
|
-
self.container: dict[
|
|
103
|
-
(ResponsePrimitive | tuple[ResponsePrimitive, ...] | frozenset[ResponsePrimitive]),
|
|
104
|
-
ResponseType,
|
|
105
|
-
] = {}
|
|
102
|
+
self.container: dict[Hashable, ResponseType] = {}
|
|
106
103
|
super().__init__(depth * 2, RESPDataType.MAP, None)
|
|
107
104
|
|
|
108
105
|
def append(self, item: ResponseType) -> None:
|
|
109
106
|
self.depth -= 1
|
|
110
107
|
if not self.key:
|
|
111
|
-
self.key =
|
|
112
|
-
ResponsePrimitive | tuple[ResponsePrimitive, ...] | frozenset[ResponsePrimitive],
|
|
113
|
-
self.ensure_hashable(item),
|
|
114
|
-
)
|
|
108
|
+
self.key = self.ensure_hashable(item)
|
|
115
109
|
else:
|
|
116
110
|
self.container[self.key] = item
|
|
117
111
|
self.key = None
|
|
@@ -121,9 +115,7 @@ class SetNode(RESPNode):
|
|
|
121
115
|
__slots__ = ("container",)
|
|
122
116
|
|
|
123
117
|
def __init__(self, depth: int) -> None:
|
|
124
|
-
self.container: MutableSet[
|
|
125
|
-
(ResponsePrimitive | tuple[ResponsePrimitive, ...] | frozenset[ResponsePrimitive])
|
|
126
|
-
] = set()
|
|
118
|
+
self.container: MutableSet[Hashable] = set()
|
|
127
119
|
super().__init__(depth, RESPDataType.SET, None)
|
|
128
120
|
|
|
129
121
|
def append(
|
|
@@ -131,12 +123,7 @@ class SetNode(RESPNode):
|
|
|
131
123
|
item: ResponseType,
|
|
132
124
|
) -> None:
|
|
133
125
|
self.depth -= 1
|
|
134
|
-
self.container.add(
|
|
135
|
-
cast(
|
|
136
|
-
ResponsePrimitive | tuple[ResponsePrimitive, ...] | frozenset[ResponsePrimitive],
|
|
137
|
-
self.ensure_hashable(item),
|
|
138
|
-
)
|
|
139
|
-
)
|
|
126
|
+
self.container.add(self.ensure_hashable(item))
|
|
140
127
|
|
|
141
128
|
|
|
142
129
|
class UnpackedResponse(NamedTuple):
|