redis 5.3.0b5__py3-none-any.whl → 6.0.0b1__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 +2 -11
- redis/_parsers/base.py +14 -2
- redis/asyncio/client.py +20 -12
- redis/asyncio/cluster.py +79 -56
- redis/asyncio/connection.py +40 -11
- redis/asyncio/lock.py +26 -5
- redis/asyncio/sentinel.py +9 -1
- redis/asyncio/utils.py +1 -1
- redis/auth/token.py +6 -2
- redis/backoff.py +15 -0
- redis/client.py +21 -14
- redis/cluster.py +111 -49
- redis/commands/cluster.py +1 -11
- redis/commands/core.py +218 -206
- redis/commands/helpers.py +0 -70
- redis/commands/redismodules.py +0 -20
- redis/commands/search/aggregation.py +3 -1
- redis/commands/search/commands.py +41 -14
- redis/commands/search/dialect.py +3 -0
- redis/commands/search/profile_information.py +14 -0
- redis/commands/search/query.py +5 -1
- redis/connection.py +37 -19
- redis/exceptions.py +4 -1
- redis/lock.py +24 -4
- redis/ocsp.py +2 -1
- redis/sentinel.py +1 -1
- redis/utils.py +107 -1
- {redis-5.3.0b5.dist-info → redis-6.0.0b1.dist-info}/METADATA +57 -23
- {redis-5.3.0b5.dist-info → redis-6.0.0b1.dist-info}/RECORD +32 -39
- {redis-5.3.0b5.dist-info → redis-6.0.0b1.dist-info}/WHEEL +1 -2
- redis/commands/graph/__init__.py +0 -263
- redis/commands/graph/commands.py +0 -313
- redis/commands/graph/edge.py +0 -91
- redis/commands/graph/exceptions.py +0 -3
- redis/commands/graph/execution_plan.py +0 -211
- redis/commands/graph/node.py +0 -88
- redis/commands/graph/path.py +0 -78
- redis/commands/graph/query_result.py +0 -588
- redis-5.3.0b5.dist-info/top_level.txt +0 -1
- /redis/commands/search/{indexDefinition.py → index_definition.py} +0 -0
- {redis-5.3.0b5.dist-info → redis-6.0.0b1.dist-info/licenses}/LICENSE +0 -0
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: redis
|
|
3
|
-
Version:
|
|
3
|
+
Version: 6.0.0b1
|
|
4
4
|
Summary: Python client for Redis database and key-value store
|
|
5
|
-
Home-page: https://github.com/redis/redis-py
|
|
6
|
-
Author: Redis Inc.
|
|
7
|
-
Author-email: oss@redis.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Project-URL: Documentation, https://redis.readthedocs.io/en/latest/
|
|
10
5
|
Project-URL: Changes, https://github.com/redis/redis-py/releases
|
|
11
6
|
Project-URL: Code, https://github.com/redis/redis-py
|
|
7
|
+
Project-URL: Documentation, https://redis.readthedocs.io/en/latest/
|
|
8
|
+
Project-URL: Homepage, https://github.com/redis/redis-py
|
|
12
9
|
Project-URL: Issue tracker, https://github.com/redis/redis-py/issues
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
Author-email: "Redis Inc." <oss@redis.com>
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: Redis,database,key-value-store
|
|
15
14
|
Classifier: Development Status :: 5 - Production/Stable
|
|
16
15
|
Classifier: Environment :: Console
|
|
17
16
|
Classifier: Intended Audience :: Developers
|
|
@@ -25,19 +24,20 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
25
24
|
Classifier: Programming Language :: Python :: 3.10
|
|
26
25
|
Classifier: Programming Language :: Python :: 3.11
|
|
27
26
|
Classifier: Programming Language :: Python :: 3.12
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
28
28
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
29
29
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
30
30
|
Requires-Python: >=3.8
|
|
31
|
-
|
|
32
|
-
License-File: LICENSE
|
|
33
|
-
Requires-Dist: PyJWT~=2.9.0
|
|
34
|
-
Requires-Dist: async-timeout>=4.0.3; python_full_version < "3.11.3"
|
|
31
|
+
Requires-Dist: async-timeout>=4.0.3; python_full_version < '3.11.3'
|
|
35
32
|
Provides-Extra: hiredis
|
|
36
|
-
Requires-Dist: hiredis>=3.0.0; extra ==
|
|
33
|
+
Requires-Dist: hiredis>=3.0.0; extra == 'hiredis'
|
|
34
|
+
Provides-Extra: jwt
|
|
35
|
+
Requires-Dist: pyjwt~=2.9.0; extra == 'jwt'
|
|
37
36
|
Provides-Extra: ocsp
|
|
38
|
-
Requires-Dist: cryptography>=36.0.1; extra ==
|
|
39
|
-
Requires-Dist: pyopenssl
|
|
40
|
-
Requires-Dist: requests>=2.31.0; extra ==
|
|
37
|
+
Requires-Dist: cryptography>=36.0.1; extra == 'ocsp'
|
|
38
|
+
Requires-Dist: pyopenssl>=20.0.1; extra == 'ocsp'
|
|
39
|
+
Requires-Dist: requests>=2.31.0; extra == 'ocsp'
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
41
|
|
|
42
42
|
# redis-py
|
|
43
43
|
|
|
@@ -54,13 +54,13 @@ The Python interface to the Redis key-value store.
|
|
|
54
54
|
|
|
55
55
|
---------------------------------------------
|
|
56
56
|
|
|
57
|
-
**Note
|
|
57
|
+
**Note:** redis-py 5.0 will be the last version of redis-py to support Python 3.7, as it has reached [end of life](https://devguide.python.org/versions/). redis-py 5.1 will support Python 3.8+.
|
|
58
58
|
|
|
59
59
|
---------------------------------------------
|
|
60
60
|
|
|
61
61
|
## How do I Redis?
|
|
62
62
|
|
|
63
|
-
[Learn for free at Redis University](https://redis.io/university
|
|
63
|
+
[Learn for free at Redis University](https://redis.io/learn/university)
|
|
64
64
|
|
|
65
65
|
[Try the Redis Cloud](https://redis.io/try-free/)
|
|
66
66
|
|
|
@@ -95,7 +95,7 @@ Looking for a high-level library to handle object mapping? See [redis-om-python]
|
|
|
95
95
|
|
|
96
96
|
## Supported Redis Versions
|
|
97
97
|
|
|
98
|
-
The most recent version of this library supports redis version [
|
|
98
|
+
The most recent version of this library supports redis version [7.2](https://github.com/redis/redis/blob/7.2/00-RELEASENOTES), [7.4](https://github.com/redis/redis/blob/7.4/00-RELEASENOTES) and [8.0](https://github.com/redis/redis/blob/8.0/00-RELEASENOTES).
|
|
99
99
|
|
|
100
100
|
The table below highlights version compatibility of the most-recent library versions and redis versions.
|
|
101
101
|
|
|
@@ -103,7 +103,8 @@ The table below highlights version compatibility of the most-recent library vers
|
|
|
103
103
|
|-----------------|-------------------|
|
|
104
104
|
| 3.5.3 | <= 6.2 Family of releases |
|
|
105
105
|
| >= 4.5.0 | Version 5.0 to 7.0 |
|
|
106
|
-
| >= 5.0.0 | Version 5.0 to
|
|
106
|
+
| >= 5.0.0 | Version 5.0 to 7.4 |
|
|
107
|
+
| >= 6.0.0 | Version 7.2 to current |
|
|
107
108
|
|
|
108
109
|
|
|
109
110
|
## Usage
|
|
@@ -193,8 +194,42 @@ The following example shows how to utilize [Redis Pub/Sub](https://redis.io/docs
|
|
|
193
194
|
{'pattern': None, 'type': 'subscribe', 'channel': b'my-second-channel', 'data': 1}
|
|
194
195
|
```
|
|
195
196
|
|
|
197
|
+
### Redis’ search and query capabilities default dialect
|
|
198
|
+
|
|
199
|
+
Release 6.0.0 introduces a client-side default dialect for Redis’ search and query capabilities.
|
|
200
|
+
By default, the client now overrides the server-side dialect with version 2, automatically appending *DIALECT 2* to commands like *FT.AGGREGATE* and *FT.SEARCH*.
|
|
196
201
|
|
|
197
|
-
|
|
202
|
+
**Important**: Be aware that the query dialect may impact the results returned. If needed, you can revert to a different dialect version by configuring the client accordingly.
|
|
203
|
+
|
|
204
|
+
``` python
|
|
205
|
+
>>> from redis.commands.search.field import TextField
|
|
206
|
+
>>> from redis.commands.search.query import Query
|
|
207
|
+
>>> from redis.commands.search.index_definition import IndexDefinition
|
|
208
|
+
>>> import redis
|
|
209
|
+
|
|
210
|
+
>>> r = redis.Redis(host='localhost', port=6379, db=0)
|
|
211
|
+
>>> r.ft().create_index(
|
|
212
|
+
>>> (TextField("name"), TextField("lastname")),
|
|
213
|
+
>>> definition=IndexDefinition(prefix=["test:"]),
|
|
214
|
+
>>> )
|
|
215
|
+
|
|
216
|
+
>>> r.hset("test:1", "name", "James")
|
|
217
|
+
>>> r.hset("test:1", "lastname", "Brown")
|
|
218
|
+
|
|
219
|
+
>>> # Query with default DIALECT 2
|
|
220
|
+
>>> query = "@name: James Brown"
|
|
221
|
+
>>> q = Query(query)
|
|
222
|
+
>>> res = r.ft().search(q)
|
|
223
|
+
|
|
224
|
+
>>> # Query with explicit DIALECT 1
|
|
225
|
+
>>> query = "@name: James Brown"
|
|
226
|
+
>>> q = Query(query).dialect(1)
|
|
227
|
+
>>> res = r.ft().search(q)
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
You can find further details in the [query dialect documentation](https://redis.io/docs/latest/develop/interact/search-and-query/advanced-concepts/dialects/).
|
|
231
|
+
|
|
232
|
+
---------------------------------------------
|
|
198
233
|
|
|
199
234
|
### Author
|
|
200
235
|
|
|
@@ -211,4 +246,3 @@ Special thanks to:
|
|
|
211
246
|
- Paul Hubbard for initial packaging support.
|
|
212
247
|
|
|
213
248
|
[](https://redis.io)
|
|
214
|
-
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
redis/__init__.py,sha256=
|
|
2
|
-
redis/backoff.py,sha256=
|
|
1
|
+
redis/__init__.py,sha256=6Q6GUD5kP-_gx4CNPPxvNEXkk9JopqQmfzDW3S4hpyA,1824
|
|
2
|
+
redis/backoff.py,sha256=d22h74LEatJiFd_5o8HvFW3biFBotYOFZHddHt45ydc,3663
|
|
3
3
|
redis/cache.py,sha256=68rJDNogvNwgdgBel6zSX9QziL11qsKIMhmvQvHvznM,9549
|
|
4
|
-
redis/client.py,sha256=
|
|
5
|
-
redis/cluster.py,sha256=
|
|
6
|
-
redis/connection.py,sha256=
|
|
4
|
+
redis/client.py,sha256=sFmv_c0vWpZiepzTPSbpao7aO4A-Wu0bX9bq7lAKiXA,62201
|
|
5
|
+
redis/cluster.py,sha256=m7ucCyLYd7J3ke5vxfCy60KCogrE2D_QTVBnwFwuga8,98748
|
|
6
|
+
redis/connection.py,sha256=lv9eC3jXSBTUwCqrrFbcQtiyz8rj3c9V4lmAPpc5Zhk,65508
|
|
7
7
|
redis/crc.py,sha256=Z3kXFtkY2LdgefnQMud1xr4vG5UYvA9LCMqNMX1ywu4,729
|
|
8
8
|
redis/credentials.py,sha256=GOnO3-LSW34efHaIrUbS742Mw8l70mRzF6UrKiKZsMY,1828
|
|
9
9
|
redis/event.py,sha256=urOK241IdgmCQ3fq7GqXRstZ2vcXRV14bBBMdN3latk,12129
|
|
10
|
-
redis/exceptions.py,sha256=
|
|
11
|
-
redis/lock.py,sha256=
|
|
12
|
-
redis/ocsp.py,sha256=
|
|
10
|
+
redis/exceptions.py,sha256=wWrzT28g_P7PMISyP2zUsYd4oFBUycSD1L5ln2_pD7o,5216
|
|
11
|
+
redis/lock.py,sha256=GrvPSxaOqKo7iAL2oi5ZUEPsOkxAXHVE_Tp1ejgO2fY,12760
|
|
12
|
+
redis/ocsp.py,sha256=teYSmKnCtk6B3jJLdNYbZN4OE0mxgspt2zUPbkIQzio,11452
|
|
13
13
|
redis/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
redis/retry.py,sha256=JiIDxeD890vgi_me8pwypO1LixwhU0Fv3A5NEay8SAY,2206
|
|
15
|
-
redis/sentinel.py,sha256=
|
|
15
|
+
redis/sentinel.py,sha256=mDIC_TKbkgRBP0JrLyBs0NkVi6-aWkBIMuqqMWgKFbk,14661
|
|
16
16
|
redis/typing.py,sha256=k7F_3Vtsexeb7mUl6txlwrY1veGDLEhtcHe9FwIJOOo,2149
|
|
17
|
-
redis/utils.py,sha256=
|
|
17
|
+
redis/utils.py,sha256=i7fltyT2JDVk6zqBZFeYlOcl3tXzJNq8kcDZZ8aXesE,8098
|
|
18
18
|
redis/_parsers/__init__.py,sha256=qkfgV2X9iyvQAvbLdSelwgz0dCk9SGAosCvuZC9-qDc,550
|
|
19
|
-
redis/_parsers/base.py,sha256=
|
|
19
|
+
redis/_parsers/base.py,sha256=WtCbM2CaOgHk7uxwWXA2KXDlZqfYA1EJrVX_NvdOZNk,7801
|
|
20
20
|
redis/_parsers/commands.py,sha256=pmR4hl4u93UvCmeDgePHFc6pWDr4slrKEvCsdMmtj_M,11052
|
|
21
21
|
redis/_parsers/encoders.py,sha256=X0jvTp-E4TZUlZxV5LJJ88TuVrF1vly5tuC0xjxGaSc,1734
|
|
22
22
|
redis/_parsers/helpers.py,sha256=X5wkGDtuzseeCz23_t3FJpzy1ltIvh7zO1uD3cypiOs,29184
|
|
@@ -25,35 +25,27 @@ redis/_parsers/resp2.py,sha256=f22kH-_ZP2iNtOn6xOe65MSy_fJpu8OEn1u_hgeeojI,4813
|
|
|
25
25
|
redis/_parsers/resp3.py,sha256=jHtL1LYJegJ_LiNTsjzIvS-kZyNR58jZ_YV4cRfwuN0,11127
|
|
26
26
|
redis/_parsers/socket.py,sha256=CKD8QW_wFSNlIZzxlbNduaGpiv0I8wBcsGuAIojDfJg,5403
|
|
27
27
|
redis/asyncio/__init__.py,sha256=uoDD8XYVi0Kj6mcufYwLDUTQXmBRx7a0bhKF9stZr7I,1489
|
|
28
|
-
redis/asyncio/client.py,sha256
|
|
29
|
-
redis/asyncio/cluster.py,sha256=
|
|
30
|
-
redis/asyncio/connection.py,sha256=
|
|
31
|
-
redis/asyncio/lock.py,sha256=
|
|
28
|
+
redis/asyncio/client.py,sha256=-U9sPfD2TD5jaW_fKOlcVzPKzYLshOnocRrFv74dRw8,61525
|
|
29
|
+
redis/asyncio/cluster.py,sha256=Kb6xptqeiSpal6PH3KItJpfyFLjrZJ0Y3BoClDQ4kCc,66868
|
|
30
|
+
redis/asyncio/connection.py,sha256=UI6CQX1TQz8yW5yqa-iv96tHn7fkuOOs13sdLglsr3Y,48061
|
|
31
|
+
redis/asyncio/lock.py,sha256=GxgV6EsyKpMjh74KtaOPxh4fNPuwApz6Th46qhvrAws,12801
|
|
32
32
|
redis/asyncio/retry.py,sha256=SnPPOlo5gcyIFtkC4DY7HFvmDgUaILsJ3DeHioogdB8,2219
|
|
33
|
-
redis/asyncio/sentinel.py,sha256=
|
|
34
|
-
redis/asyncio/utils.py,sha256=
|
|
33
|
+
redis/asyncio/sentinel.py,sha256=HS5UbVlvrGuOcvQoFBHDXvf2YkYjUnKEhkxS_RG-oRk,14540
|
|
34
|
+
redis/asyncio/utils.py,sha256=31xFzXczDgSRyf6hSjiwue1eDQ_XlP_OJdp5dKxW_aE,718
|
|
35
35
|
redis/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
36
|
redis/auth/err.py,sha256=WYkbuDIzwp1S-eAvsya6QMlO6g9QIXbzMITOsTWX0xk,694
|
|
37
37
|
redis/auth/idp.py,sha256=IMDIIb9q72vbIwtFN8vPdaAKZVTdh0HuC5uj5ufqmw4,631
|
|
38
|
-
redis/auth/token.py,sha256=
|
|
38
|
+
redis/auth/token.py,sha256=qYwAgxFW3S93QDUqp1BTsj7Pj9ZohnixGeOX0s7AsjY,3317
|
|
39
39
|
redis/auth/token_manager.py,sha256=ShBsYXiBZBJBOMB_Y-pXfLwEOAmc9s1okaCECinNZ7g,12018
|
|
40
40
|
redis/commands/__init__.py,sha256=cTUH-MGvaLYS0WuoytyqtN1wniw2A1KbkUXcpvOSY3I,576
|
|
41
|
-
redis/commands/cluster.py,sha256=
|
|
42
|
-
redis/commands/core.py,sha256=
|
|
43
|
-
redis/commands/helpers.py,sha256=
|
|
44
|
-
redis/commands/redismodules.py,sha256=
|
|
41
|
+
redis/commands/cluster.py,sha256=vdWdpl4mP51oqfYBZHg5CUXt6jPaNp7aCLHyTieDrt8,31248
|
|
42
|
+
redis/commands/core.py,sha256=Ca_OhsXzLov3NTaSjIJvRGxzYmePKbdRxowrEbdh91w,238477
|
|
43
|
+
redis/commands/helpers.py,sha256=f1BDIVgfjyE8xTyTjcVH_vffaNTSd6r1ScN_CcJFbmk,2950
|
|
44
|
+
redis/commands/redismodules.py,sha256=y9gxuqY7PmUjpeKLzjQFcN_gZ2IVs36jxq7sSnvG9Nc,1966
|
|
45
45
|
redis/commands/sentinel.py,sha256=hRcIQ9x9nEkdcCsJzo6Ves6vk-3tsfQqfJTT_v3oLY0,4110
|
|
46
46
|
redis/commands/bf/__init__.py,sha256=qk4DA9KsMiP4WYqYeP1T5ScBwctsVtlLyMhrYIyq1Zc,8019
|
|
47
47
|
redis/commands/bf/commands.py,sha256=xeKt8E7G8HB-l922J0DLg07CEIZTVNGx_2Lfyw1gIck,21283
|
|
48
48
|
redis/commands/bf/info.py,sha256=_OB2v_hAPI9mdVNiBx8jUtH2MhMoct9ZRm-e8In6wQo,3355
|
|
49
|
-
redis/commands/graph/__init__.py,sha256=obrFOuwUpNgJA_3NsyRxdqXYzLw4oQRkBxBoMCPAtOw,7235
|
|
50
|
-
redis/commands/graph/commands.py,sha256=DMLwSQRUiCTv_hipwm7v5Uq79Sgau-Ao7I6OyIb45co,10374
|
|
51
|
-
redis/commands/graph/edge.py,sha256=_TljVB4a1pPS9pb8_Cvw8rclbBOOI__-fY9fybU4djQ,2460
|
|
52
|
-
redis/commands/graph/exceptions.py,sha256=kRDBsYLgwIaM4vqioO_Bp_ugWvjfqCH7DIv4Gpc9HCM,107
|
|
53
|
-
redis/commands/graph/execution_plan.py,sha256=Pxr8_zhPWT_EdZSgGrbiWw8wFL6q5JF7O-Z6Xzm55iw,6742
|
|
54
|
-
redis/commands/graph/node.py,sha256=Pasfsl5dF6WqT9KCNFAKKwGubyK_2ORCoAQE4VtnXkQ,2400
|
|
55
|
-
redis/commands/graph/path.py,sha256=m6Gz4DYfMIQ8VReDLHlnQw_KI2rVdepWYk_AU0_x_GM,2080
|
|
56
|
-
redis/commands/graph/query_result.py,sha256=ALDXsFNJbnZ8zivX2Xd2_-pP8ka0pYym2HQ-MRTePIQ,17521
|
|
57
49
|
redis/commands/json/__init__.py,sha256=llpDQz2kBNnJyfQfuh0-2oY-knMb6gAS0ADtPmaTKsM,4854
|
|
58
50
|
redis/commands/json/_util.py,sha256=b_VQTh10FyLl8BtREfJfDagOJCyd6wTQQs8g63pi5GI,116
|
|
59
51
|
redis/commands/json/commands.py,sha256=8CRierNqK_VfFoaa9s0rr28uZmqs7nQaAuz4qo0UYZY,15747
|
|
@@ -61,12 +53,14 @@ redis/commands/json/decoders.py,sha256=a_IoMV_wgeJyUifD4P6HTcM9s6FhricwmzQcZRmc-
|
|
|
61
53
|
redis/commands/json/path.py,sha256=0zaO6_q_FVMk1Bkhkb7Wcr8AF2Tfr69VhkKy1IBVhpA,393
|
|
62
54
|
redis/commands/search/__init__.py,sha256=happQFVF0j7P87p7LQsUK5AK0kuem9cA-xvVRdQWpos,5744
|
|
63
55
|
redis/commands/search/_util.py,sha256=9Mp72OO5Ib5UbfN7uXb-iB7hQCm1jQLV90ms2P9XSGU,219
|
|
64
|
-
redis/commands/search/aggregation.py,sha256=
|
|
65
|
-
redis/commands/search/commands.py,sha256=
|
|
56
|
+
redis/commands/search/aggregation.py,sha256=CcZSZyquLWLrcSblwgt-bSyMvm-TQS9B7N8QI_ahCBU,11582
|
|
57
|
+
redis/commands/search/commands.py,sha256=U7NZY_s8LDMBRVO9Es2-9P1loIZJ7og4qx3TUgnDOiw,38285
|
|
58
|
+
redis/commands/search/dialect.py,sha256=-7M6kkr33x0FkMtKmUsbeRAE6qxLUbqdJCqIo0UKIXo,105
|
|
66
59
|
redis/commands/search/document.py,sha256=g2R-PRgq-jN33_GLXzavvse4cpIHBMfjPfPK7tnE9Gc,413
|
|
67
60
|
redis/commands/search/field.py,sha256=ZWHYTtrLi-zZojohqXoidfllxP0SiadBW6hnGkBw7mM,5891
|
|
68
|
-
redis/commands/search/
|
|
69
|
-
redis/commands/search/
|
|
61
|
+
redis/commands/search/index_definition.py,sha256=VL2CMzjxN0HEIaTn88evnHX1fCEmytbik4vAmiiYSC8,2489
|
|
62
|
+
redis/commands/search/profile_information.py,sha256=w9SbMiHbcZ1TpsZMe8cMIyO1hGkm5GhnZ_Gqg1feLtc,249
|
|
63
|
+
redis/commands/search/query.py,sha256=MbSs-cY7hG1OEkO-i6LJ_Ui1D3d2VyDTXPrmb-rty7w,12199
|
|
70
64
|
redis/commands/search/querystring.py,sha256=dE577kOqkCErNgO-IXI4xFVHI8kQE-JiH5ZRI_CKjHE,7597
|
|
71
65
|
redis/commands/search/reducers.py,sha256=Scceylx8BjyqS-TJOdhNW63n6tecL9ojt4U5Sqho5UY,4220
|
|
72
66
|
redis/commands/search/result.py,sha256=iuqmwOeCNo_7N4a_YxxDzVdOTpbwfF1T2uuq5sTqzMo,2624
|
|
@@ -75,8 +69,7 @@ redis/commands/timeseries/__init__.py,sha256=gkz6wshEzzQQryBOnrAqqQzttS-AHfXmuN_
|
|
|
75
69
|
redis/commands/timeseries/commands.py,sha256=8Z2BEyP23qTYCJR_e9zdG11yWmIDwGBMO2PJNLtK2BA,47147
|
|
76
70
|
redis/commands/timeseries/info.py,sha256=meZYdu7IV9KaUWMKZs9qW4vo3Q9MwhdY-EBtKQzls5o,3223
|
|
77
71
|
redis/commands/timeseries/utils.py,sha256=NLwSOS5Dz9N8dYQSzEyBIvrItOWwfQ0xgDj8un6x3dU,1319
|
|
78
|
-
redis-
|
|
79
|
-
redis-
|
|
80
|
-
redis-
|
|
81
|
-
redis-
|
|
82
|
-
redis-5.3.0b5.dist-info/RECORD,,
|
|
72
|
+
redis-6.0.0b1.dist-info/METADATA,sha256=RRAjsLblR6FuHuafiPdggI22QVT943Bq439D5zAARhk,10510
|
|
73
|
+
redis-6.0.0b1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
74
|
+
redis-6.0.0b1.dist-info/licenses/LICENSE,sha256=pXslClvwPXr-VbdAYzE_Ktt7ANVGwKsUmok5gzP-PMg,1074
|
|
75
|
+
redis-6.0.0b1.dist-info/RECORD,,
|
redis/commands/graph/__init__.py
DELETED
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
import warnings
|
|
2
|
-
|
|
3
|
-
from ..helpers import quote_string, random_string, stringify_param_value
|
|
4
|
-
from .commands import AsyncGraphCommands, GraphCommands
|
|
5
|
-
from .edge import Edge # noqa
|
|
6
|
-
from .node import Node # noqa
|
|
7
|
-
from .path import Path # noqa
|
|
8
|
-
|
|
9
|
-
DB_LABELS = "DB.LABELS"
|
|
10
|
-
DB_RAELATIONSHIPTYPES = "DB.RELATIONSHIPTYPES"
|
|
11
|
-
DB_PROPERTYKEYS = "DB.PROPERTYKEYS"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class Graph(GraphCommands):
|
|
15
|
-
"""
|
|
16
|
-
Graph, collection of nodes and edges.
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
def __init__(self, client, name=random_string()):
|
|
20
|
-
"""
|
|
21
|
-
Create a new graph.
|
|
22
|
-
"""
|
|
23
|
-
warnings.warn(
|
|
24
|
-
DeprecationWarning(
|
|
25
|
-
"RedisGraph support is deprecated as of Redis Stack 7.2 \
|
|
26
|
-
(https://redis.com/blog/redisgraph-eol/)"
|
|
27
|
-
)
|
|
28
|
-
)
|
|
29
|
-
self.NAME = name # Graph key
|
|
30
|
-
self.client = client
|
|
31
|
-
self.execute_command = client.execute_command
|
|
32
|
-
|
|
33
|
-
self.nodes = {}
|
|
34
|
-
self.edges = []
|
|
35
|
-
self._labels = [] # List of node labels.
|
|
36
|
-
self._properties = [] # List of properties.
|
|
37
|
-
self._relationship_types = [] # List of relation types.
|
|
38
|
-
self.version = 0 # Graph version
|
|
39
|
-
|
|
40
|
-
@property
|
|
41
|
-
def name(self):
|
|
42
|
-
return self.NAME
|
|
43
|
-
|
|
44
|
-
def _clear_schema(self):
|
|
45
|
-
self._labels = []
|
|
46
|
-
self._properties = []
|
|
47
|
-
self._relationship_types = []
|
|
48
|
-
|
|
49
|
-
def _refresh_schema(self):
|
|
50
|
-
self._clear_schema()
|
|
51
|
-
self._refresh_labels()
|
|
52
|
-
self._refresh_relations()
|
|
53
|
-
self._refresh_attributes()
|
|
54
|
-
|
|
55
|
-
def _refresh_labels(self):
|
|
56
|
-
lbls = self.labels()
|
|
57
|
-
|
|
58
|
-
# Unpack data.
|
|
59
|
-
self._labels = [l[0] for _, l in enumerate(lbls)]
|
|
60
|
-
|
|
61
|
-
def _refresh_relations(self):
|
|
62
|
-
rels = self.relationship_types()
|
|
63
|
-
|
|
64
|
-
# Unpack data.
|
|
65
|
-
self._relationship_types = [r[0] for _, r in enumerate(rels)]
|
|
66
|
-
|
|
67
|
-
def _refresh_attributes(self):
|
|
68
|
-
props = self.property_keys()
|
|
69
|
-
|
|
70
|
-
# Unpack data.
|
|
71
|
-
self._properties = [p[0] for _, p in enumerate(props)]
|
|
72
|
-
|
|
73
|
-
def get_label(self, idx):
|
|
74
|
-
"""
|
|
75
|
-
Returns a label by it's index
|
|
76
|
-
|
|
77
|
-
Args:
|
|
78
|
-
|
|
79
|
-
idx:
|
|
80
|
-
The index of the label
|
|
81
|
-
"""
|
|
82
|
-
try:
|
|
83
|
-
label = self._labels[idx]
|
|
84
|
-
except IndexError:
|
|
85
|
-
# Refresh labels.
|
|
86
|
-
self._refresh_labels()
|
|
87
|
-
label = self._labels[idx]
|
|
88
|
-
return label
|
|
89
|
-
|
|
90
|
-
def get_relation(self, idx):
|
|
91
|
-
"""
|
|
92
|
-
Returns a relationship type by it's index
|
|
93
|
-
|
|
94
|
-
Args:
|
|
95
|
-
|
|
96
|
-
idx:
|
|
97
|
-
The index of the relation
|
|
98
|
-
"""
|
|
99
|
-
try:
|
|
100
|
-
relationship_type = self._relationship_types[idx]
|
|
101
|
-
except IndexError:
|
|
102
|
-
# Refresh relationship types.
|
|
103
|
-
self._refresh_relations()
|
|
104
|
-
relationship_type = self._relationship_types[idx]
|
|
105
|
-
return relationship_type
|
|
106
|
-
|
|
107
|
-
def get_property(self, idx):
|
|
108
|
-
"""
|
|
109
|
-
Returns a property by it's index
|
|
110
|
-
|
|
111
|
-
Args:
|
|
112
|
-
|
|
113
|
-
idx:
|
|
114
|
-
The index of the property
|
|
115
|
-
"""
|
|
116
|
-
try:
|
|
117
|
-
p = self._properties[idx]
|
|
118
|
-
except IndexError:
|
|
119
|
-
# Refresh properties.
|
|
120
|
-
self._refresh_attributes()
|
|
121
|
-
p = self._properties[idx]
|
|
122
|
-
return p
|
|
123
|
-
|
|
124
|
-
def add_node(self, node):
|
|
125
|
-
"""
|
|
126
|
-
Adds a node to the graph.
|
|
127
|
-
"""
|
|
128
|
-
if node.alias is None:
|
|
129
|
-
node.alias = random_string()
|
|
130
|
-
self.nodes[node.alias] = node
|
|
131
|
-
|
|
132
|
-
def add_edge(self, edge):
|
|
133
|
-
"""
|
|
134
|
-
Adds an edge to the graph.
|
|
135
|
-
"""
|
|
136
|
-
if not (self.nodes[edge.src_node.alias] and self.nodes[edge.dest_node.alias]):
|
|
137
|
-
raise AssertionError("Both edge's end must be in the graph")
|
|
138
|
-
|
|
139
|
-
self.edges.append(edge)
|
|
140
|
-
|
|
141
|
-
def _build_params_header(self, params):
|
|
142
|
-
if params is None:
|
|
143
|
-
return ""
|
|
144
|
-
if not isinstance(params, dict):
|
|
145
|
-
raise TypeError("'params' must be a dict")
|
|
146
|
-
# Header starts with "CYPHER"
|
|
147
|
-
params_header = "CYPHER "
|
|
148
|
-
for key, value in params.items():
|
|
149
|
-
params_header += str(key) + "=" + stringify_param_value(value) + " "
|
|
150
|
-
return params_header
|
|
151
|
-
|
|
152
|
-
# Procedures.
|
|
153
|
-
def call_procedure(self, procedure, *args, read_only=False, **kwagrs):
|
|
154
|
-
args = [quote_string(arg) for arg in args]
|
|
155
|
-
q = f"CALL {procedure}({','.join(args)})"
|
|
156
|
-
|
|
157
|
-
y = kwagrs.get("y", None)
|
|
158
|
-
if y is not None:
|
|
159
|
-
q += f"YIELD {','.join(y)}"
|
|
160
|
-
|
|
161
|
-
return self.query(q, read_only=read_only)
|
|
162
|
-
|
|
163
|
-
def labels(self):
|
|
164
|
-
return self.call_procedure(DB_LABELS, read_only=True).result_set
|
|
165
|
-
|
|
166
|
-
def relationship_types(self):
|
|
167
|
-
return self.call_procedure(DB_RAELATIONSHIPTYPES, read_only=True).result_set
|
|
168
|
-
|
|
169
|
-
def property_keys(self):
|
|
170
|
-
return self.call_procedure(DB_PROPERTYKEYS, read_only=True).result_set
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
class AsyncGraph(Graph, AsyncGraphCommands):
|
|
174
|
-
"""Async version for Graph"""
|
|
175
|
-
|
|
176
|
-
async def _refresh_labels(self):
|
|
177
|
-
lbls = await self.labels()
|
|
178
|
-
|
|
179
|
-
# Unpack data.
|
|
180
|
-
self._labels = [l[0] for _, l in enumerate(lbls)]
|
|
181
|
-
|
|
182
|
-
async def _refresh_attributes(self):
|
|
183
|
-
props = await self.property_keys()
|
|
184
|
-
|
|
185
|
-
# Unpack data.
|
|
186
|
-
self._properties = [p[0] for _, p in enumerate(props)]
|
|
187
|
-
|
|
188
|
-
async def _refresh_relations(self):
|
|
189
|
-
rels = await self.relationship_types()
|
|
190
|
-
|
|
191
|
-
# Unpack data.
|
|
192
|
-
self._relationship_types = [r[0] for _, r in enumerate(rels)]
|
|
193
|
-
|
|
194
|
-
async def get_label(self, idx):
|
|
195
|
-
"""
|
|
196
|
-
Returns a label by it's index
|
|
197
|
-
|
|
198
|
-
Args:
|
|
199
|
-
|
|
200
|
-
idx:
|
|
201
|
-
The index of the label
|
|
202
|
-
"""
|
|
203
|
-
try:
|
|
204
|
-
label = self._labels[idx]
|
|
205
|
-
except IndexError:
|
|
206
|
-
# Refresh labels.
|
|
207
|
-
await self._refresh_labels()
|
|
208
|
-
label = self._labels[idx]
|
|
209
|
-
return label
|
|
210
|
-
|
|
211
|
-
async def get_property(self, idx):
|
|
212
|
-
"""
|
|
213
|
-
Returns a property by it's index
|
|
214
|
-
|
|
215
|
-
Args:
|
|
216
|
-
|
|
217
|
-
idx:
|
|
218
|
-
The index of the property
|
|
219
|
-
"""
|
|
220
|
-
try:
|
|
221
|
-
p = self._properties[idx]
|
|
222
|
-
except IndexError:
|
|
223
|
-
# Refresh properties.
|
|
224
|
-
await self._refresh_attributes()
|
|
225
|
-
p = self._properties[idx]
|
|
226
|
-
return p
|
|
227
|
-
|
|
228
|
-
async def get_relation(self, idx):
|
|
229
|
-
"""
|
|
230
|
-
Returns a relationship type by it's index
|
|
231
|
-
|
|
232
|
-
Args:
|
|
233
|
-
|
|
234
|
-
idx:
|
|
235
|
-
The index of the relation
|
|
236
|
-
"""
|
|
237
|
-
try:
|
|
238
|
-
relationship_type = self._relationship_types[idx]
|
|
239
|
-
except IndexError:
|
|
240
|
-
# Refresh relationship types.
|
|
241
|
-
await self._refresh_relations()
|
|
242
|
-
relationship_type = self._relationship_types[idx]
|
|
243
|
-
return relationship_type
|
|
244
|
-
|
|
245
|
-
async def call_procedure(self, procedure, *args, read_only=False, **kwagrs):
|
|
246
|
-
args = [quote_string(arg) for arg in args]
|
|
247
|
-
q = f"CALL {procedure}({','.join(args)})"
|
|
248
|
-
|
|
249
|
-
y = kwagrs.get("y", None)
|
|
250
|
-
if y is not None:
|
|
251
|
-
f"YIELD {','.join(y)}"
|
|
252
|
-
return await self.query(q, read_only=read_only)
|
|
253
|
-
|
|
254
|
-
async def labels(self):
|
|
255
|
-
return (await self.call_procedure(DB_LABELS, read_only=True)).result_set
|
|
256
|
-
|
|
257
|
-
async def property_keys(self):
|
|
258
|
-
return (await self.call_procedure(DB_PROPERTYKEYS, read_only=True)).result_set
|
|
259
|
-
|
|
260
|
-
async def relationship_types(self):
|
|
261
|
-
return (
|
|
262
|
-
await self.call_procedure(DB_RAELATIONSHIPTYPES, read_only=True)
|
|
263
|
-
).result_set
|