Skip to content

Commit 590b28d

Browse files
committed
Merge branch 'master' of github.com:redis/redis-py into 7.0
2 parents de4083f + f3806fa commit 590b28d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+11902
-83
lines changed

.github/wordlist.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
APM
22
ARGV
33
BFCommands
4+
balancer
45
CacheImpl
6+
cancelling
57
CAS
68
CFCommands
79
CMSCommands
@@ -10,19 +12,32 @@ ClusterNodes
1012
ClusterPipeline
1113
ClusterPubSub
1214
ConnectionPool
15+
config
1316
CoreCommands
17+
DatabaseConfig
18+
DNS
19+
EchoHealthCheck
1420
EVAL
1521
EVALSHA
22+
failover
23+
FQDN
1624
Grokzen's
25+
Healthcheck
26+
HealthCheckPolicies
27+
healthcheck
28+
healthchecks
1729
INCR
1830
IOError
1931
Instrumentations
2032
JSONCommands
2133
Jaeger
2234
Ludovico
2335
Magnocavallo
36+
MultiDbConfig
37+
MultiDBClient
2438
McCurdy
2539
NOSCRIPT
40+
NoValidDatabaseException
2641
NUMPAT
2742
NUMPT
2843
NUMSUB
@@ -43,6 +58,7 @@ RedisInstrumentor
4358
RedisJSON
4459
RedisTimeSeries
4560
SHA
61+
SLA
4662
SearchCommands
4763
SentinelCommands
4864
SentinelConnectionPool
@@ -52,6 +68,8 @@ SpanKind
5268
Specfiying
5369
StatusCode
5470
TCP
71+
TemporaryUnavailableException
72+
TLS
5573
TOPKCommands
5674
TimeSeriesCommands
5775
Uptrace
@@ -91,6 +109,7 @@ json
91109
keyslot
92110
keyspace
93111
kwarg
112+
kwargs
94113
linters
95114
localhost
96115
lua

.github/workflows/docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- uses: actions/checkout@v5
29-
- uses: actions/setup-python@v5
29+
- uses: actions/setup-python@v6
3030
with:
3131
python-version: 3.9
3232
cache: 'pip'

.github/workflows/install_and_test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ cd ${TESTDIR}
4040
# install, run tests
4141
pip install ${PKG}
4242
# Redis tests
43-
pytest -m 'not onlycluster' --ignore=tests/test_scenario
43+
pytest -m 'not onlycluster' --ignore=tests/test_scenario --ignore=tests/test_asyncio/test_scenario
4444
# RedisCluster tests
4545
CLUSTER_URL="redis://localhost:16379/0"
4646
CLUSTER_SSL_URL="rediss://localhost:27379/0"
4747
pytest -m 'not onlynoncluster and not redismod and not ssl' \
4848
--ignore=tests/test_scenario \
49+
--ignore=tests/test_asyncio/test_scenario \
4950
--redis-url="${CLUSTER_URL}" \
5051
--redis-ssl-url="${CLUSTER_SSL_URL}"

.github/workflows/integration.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ env:
2727
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2828
# this speeds up coverage with Python 3.12: https://github.com/nedbat/coveragepy/issues/1665
2929
COVERAGE_CORE: sysmon
30+
# patch releases get included in the base version image when they are published
31+
# for example after 8.2.1 is published, 8.2 image contains 8.2.1 content
3032
CURRENT_CLIENT_LIBS_TEST_STACK_IMAGE_TAG: '8.2'
3133
CURRENT_REDIS_VERSION: '8.2'
3234

@@ -47,7 +49,7 @@ jobs:
4749
runs-on: ubuntu-latest
4850
steps:
4951
- uses: actions/checkout@v5
50-
- uses: actions/setup-python@v5
52+
- uses: actions/setup-python@v6
5153
with:
5254
python-version: 3.9
5355
cache: 'pip'
@@ -74,7 +76,7 @@ jobs:
7476
max-parallel: 15
7577
fail-fast: false
7678
matrix:
77-
redis-version: ['8.2.1-pre', '${{ needs.redis_version.outputs.CURRENT }}', '8.0.2' ,'7.4.4', '7.2.9']
79+
redis-version: ['8.4-M01-pre', '${{ needs.redis_version.outputs.CURRENT }}', '8.0.2' ,'7.4.4', '7.2.9']
7880
python-version: ['3.9', '3.13']
7981
parser-backend: ['plain']
8082
event-loop: ['asyncio']
@@ -175,7 +177,7 @@ jobs:
175177
extension: ['tar.gz', 'whl']
176178
steps:
177179
- uses: actions/checkout@v5
178-
- uses: actions/setup-python@v5
180+
- uses: actions/setup-python@v6
179181
with:
180182
python-version: 3.9
181183
- name: Run installed unit tests
@@ -194,7 +196,7 @@ jobs:
194196
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10']
195197
steps:
196198
- uses: actions/checkout@v5
197-
- uses: actions/setup-python@v5
199+
- uses: actions/setup-python@v6
198200
with:
199201
python-version: ${{ matrix.python-version }}
200202
cache: 'pip'

.github/workflows/pypi-publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v5
1717
- name: install python
18-
uses: actions/setup-python@v5
18+
uses: actions/setup-python@v6
1919
with:
2020
python-version: 3.9
2121
- run: pip install build twine

.github/workflows/spellcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- name: Checkout
99
uses: actions/checkout@v5
1010
- name: Check Spelling
11-
uses: rojopolis/spellcheck-github-actions@0.51.0
11+
uses: rojopolis/spellcheck-github-actions@0.52.0
1212
with:
1313
config_path: .github/spellcheck-settings.yml
1414
task_name: Markdown

.github/workflows/stale-issues.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121
# First step: Handle regular issues (excluding needs-information)
2222
- name: Mark regular issues as stale
23-
uses: actions/stale@v9
23+
uses: actions/stale@v10
2424
with:
2525
repo-token: ${{ secrets.GITHUB_TOKEN }}
2626

@@ -64,7 +64,7 @@ jobs:
6464

6565
# Second step: Handle needs-information issues with accelerated timeline
6666
- name: Mark needs-information issues as stale
67-
uses: actions/stale@v9
67+
uses: actions/stale@v10
6868
with:
6969
repo-token: ${{ secrets.GITHUB_TOKEN }}
7070

dev_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ uvloop
1414
vulture>=2.3.0
1515
numpy>=1.24.0
1616
redis-entraid==1.0.0
17+
pybreaker>=1.4.0

docs/examples/pipeline_examples.ipynb

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,67 @@
156156
"pipe.set(\"a\", \"a value\").set(\"b\", \"b value\").get(\"a\").execute()"
157157
]
158158
},
159+
{
160+
"cell_type": "markdown",
161+
"metadata": {},
162+
"source": [
163+
"Here's a slightly more advanced example for chaining complex operations using the builder pattern."
164+
]
165+
},
166+
{
167+
"cell_type": "code",
168+
"execution_count": null,
169+
"metadata": {},
170+
"outputs": [],
171+
"source": [
172+
"from dataclasses import dataclass\n",
173+
"from typing import Optional\n",
174+
"\n",
175+
"@dataclass\n",
176+
"class User:\n",
177+
" email: str\n",
178+
" username: Optional[str] = None\n",
179+
"\n",
180+
"@dataclass\n",
181+
"class Post:\n",
182+
" title: str\n",
183+
" body: str\n",
184+
" author: Optional[str] = None\n",
185+
"\n",
186+
"class RedisRepository:\n",
187+
" def __init__(self):\n",
188+
" self.pipeline = r.pipeline()\n",
189+
"\n",
190+
" def add_user(self, user: User):\n",
191+
" if not user.username:\n",
192+
" user.username = user.email.split(\"@\")[0]\n",
193+
" self.pipeline.hset(f\"user:{user.username}\", mapping={\"username\": user.username, \"email\": user.email})\n",
194+
" return self\n",
195+
" \n",
196+
" def add_post(self, post: Post):\n",
197+
" self.pipeline.hset(f\"post:#{post.title}#\", mapping={\"title\": post.title, \"body\": post.body, \"author\": post.author})\n",
198+
" if post.author:\n",
199+
" self.pipeline.sadd(f\"user:{post.author}:posts\", f\"post:#{post.title}#\")\n",
200+
" return self\n",
201+
"\n",
202+
" def add_follow(self, follower: str, following: str):\n",
203+
" self.pipeline.sadd(f\"user:{follower}:following\", following)\n",
204+
" self.pipeline.sadd(f\"user:{following}:followers\", follower)\n",
205+
" return self\n",
206+
"\n",
207+
" def execute(self):\n",
208+
" return self.pipeline.execute()\n",
209+
"\n",
210+
"pipe = RedisRepository()\n",
211+
"results = (pipe\n",
212+
" .add_user(User(email=\"[email protected]\"))\n",
213+
" .add_user(User(email=\"[email protected]\"))\n",
214+
" .add_follow(\"alice\", \"bob\")\n",
215+
" .add_post(Post(title=\"Hello World\", body=\"I'm using Redis!\", author=\"alice\"))\n",
216+
" .execute()\n",
217+
")"
218+
]
219+
},
159220
{
160221
"cell_type": "markdown",
161222
"metadata": {},

0 commit comments

Comments
 (0)