Skip to content

Commit 772c716

Browse files
authored
Merge branch 'master' into cluster-fixes
2 parents 8748bdc + bea00b1 commit 772c716

16 files changed

+218
-420
lines changed

.github/release-drafter-config.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name-template: '$NEXT_MAJOR_VERSION'
2-
tag-template: 'v$NEXT_MAJOR_VERSION'
1+
name-template: '$NEXT_MINOR_VERSION'
2+
tag-template: 'v$NEXT_MINOR_VERSION'
33
autolabeler:
44
- label: 'maintenance'
55
files:
@@ -18,7 +18,6 @@ categories:
1818
- title: 'Breaking Changes'
1919
labels:
2020
- 'breakingchange'
21-
2221
- title: '🧪 Experimental Features'
2322
labels:
2423
- 'experimental'
@@ -38,7 +37,7 @@ change-template: '- $TITLE (#$NUMBER)'
3837
exclude-labels:
3938
- 'skip-changelog'
4039
template: |
41-
## Changes
40+
# Changes
4241
4342
$CHANGES
4443

.github/workflows/integration.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
- uses: pypa/[email protected]
2727
with:
2828
inputs: requirements.txt dev_requirements.txt
29+
ignore-vulns: |
30+
GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
2931
3032
lint:
3133
name: Code linters

docs/redismodules.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ These are the commands for interacting with the `RedisJSON module <https://redis
9191
9292
import redis
9393
r = redis.Redis()
94-
r.json().set("mykey", ".", {"hello": "world", "i am": ["a", "json", "object!"]}
94+
r.json().set("mykey", ".", {"hello": "world", "i am": ["a", "json", "object!"]})
9595
9696
Examples of how to combine search and json can be found `here <examples/search_json_examples.html>`_.
9797

redis/asyncio/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ async def get_connection(self, command_name, *keys, **options):
14451445
try:
14461446
if await connection.can_read_destructive():
14471447
raise ConnectionError("Connection has data") from None
1448-
except ConnectionError:
1448+
except (ConnectionError, OSError):
14491449
await connection.disconnect()
14501450
await connection.connect()
14511451
if await connection.can_read_destructive():
@@ -1646,7 +1646,7 @@ async def get_connection(self, command_name, *keys, **options):
16461646
try:
16471647
if await connection.can_read_destructive():
16481648
raise ConnectionError("Connection has data") from None
1649-
except ConnectionError:
1649+
except (ConnectionError, OSError):
16501650
await connection.disconnect()
16511651
await connection.connect()
16521652
if await connection.can_read_destructive():

redis/commands/search/commands.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import time
33
from typing import Dict, Optional, Union
44

5+
from deprecated import deprecated
6+
57
from redis.client import Pipeline
68

79
from ..helpers import parse_to_dict
@@ -236,6 +238,9 @@ def _add_document_hash(
236238

237239
return self.execute_command(*args)
238240

241+
@deprecated(
242+
version="2.0.0", reason="deprecated since redisearch 2.0, call hset instead"
243+
)
239244
def add_document(
240245
self,
241246
doc_id,
@@ -289,6 +294,9 @@ def add_document(
289294
**fields,
290295
)
291296

297+
@deprecated(
298+
version="2.0.0", reason="deprecated since redisearch 2.0, call hset instead"
299+
)
292300
def add_document_hash(self, doc_id, score=1.0, language=None, replace=False):
293301
"""
294302
Add a hash document to the index.

redis/commands/search/querystring.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ def __init__(self, lon, lat, radius, unit="km"):
132132
self.radius = radius
133133
self.unit = unit
134134

135+
def to_string(self):
136+
return f"[{self.lon} {self.lat} {self.radius} {self.unit}]"
137+
135138

136139
class Node:
137140
def __init__(self, *children, **kwparams):

tests/test_asyncio/test_bloom.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,9 @@ async def test_tdigest_rank(modclient: redis.Redis):
426426
assert await modclient.tdigest().create("t-digest", 500)
427427
assert await modclient.tdigest().add("t-digest", list(range(0, 20)))
428428
assert -1 == (await modclient.tdigest().rank("t-digest", -1))[0]
429-
assert 1 == (await modclient.tdigest().rank("t-digest", 0))[0]
430-
assert 11 == (await modclient.tdigest().rank("t-digest", 10))[0]
431-
assert [-1, 20, 10] == await modclient.tdigest().rank("t-digest", -20, 20, 9)
429+
assert 0 == (await modclient.tdigest().rank("t-digest", 0))[0]
430+
assert 10 == (await modclient.tdigest().rank("t-digest", 10))[0]
431+
assert [-1, 20, 9] == await modclient.tdigest().rank("t-digest", -20, 20, 9)
432432

433433

434434
@pytest.mark.redismod

tests/test_asyncio/test_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ async def test_objlen_dollar(modclient: redis.Redis):
817817
},
818818
)
819819
# Test multi
820-
assert await modclient.json().objlen("doc1", "$..a") == [2, None, 1]
820+
assert await modclient.json().objlen("doc1", "$..a") == [None, 2, 1]
821821
# Test single
822822
assert await modclient.json().objlen("doc1", "$.nested1.a") == [2]
823823

0 commit comments

Comments
 (0)