Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master to 5.0 #2827

Merged
merged 53 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
4802530
fix: do not use asyncio's timeout lib before 3.11.2 (#2659)
bellini666 Mar 27, 2023
4856813
UnixDomainSocketConnection missing constructor argument (#2630)
woutdenolf Mar 27, 2023
326bb1c
removing useless files (#2642)
chayim Mar 27, 2023
6d886d7
Fix issue 2660: PytestUnraisableExceptionWarning from asycio client (…
shacharPash Mar 28, 2023
5acbde3
Fixing cancelled async futures (#2666)
chayim Mar 29, 2023
ef3f086
Fix async (#2673)
dvora-h Mar 29, 2023
e1017fd
Version 4.5.4 (#2674)
dvora-h Mar 29, 2023
7ae8464
Really do not use asyncio's timeout lib before 3.11.2 (#2699)
mirekdlugosz Apr 13, 2023
6a4240b
asyncio: Fix memory leak caused by hiredis (#2693) (#2694)
oranav Apr 13, 2023
db9a85c
Update example of Redisearch creating index (#2703)
mzdehbashi-github Apr 13, 2023
7fc4c76
Improving Vector Similarity Search Example (#2661)
tylerhutcherson Apr 13, 2023
d6bb457
Fix incorrect usage of once flag in async Sentinel (#2718)
felipou Apr 27, 2023
fddd3d6
Fix topk list example. (#2724)
AYMENJD Apr 27, 2023
8e0b84d
Improve error output for master discovery (#2720)
scoopex Apr 27, 2023
8b58ebb
return response in case of KeyError (#2628)
shacharPash Apr 30, 2023
bf528fc
Add WITHSCORES to ZREVRANK Command (#2725)
shacharPash Apr 30, 2023
1ca223a
Fix `ClusterCommandProtocol` not itself being marked as a protocol (#…
Avasam May 1, 2023
ac15d52
Fix potential race condition during disconnection (#2719)
Anthchirp May 1, 2023
a7857e1
add "address_remap" feature to RedisCluster (#2726)
kristjanvalur May 2, 2023
e52fd67
nermina changes from NRedisStack (#2736)
shacharPash May 2, 2023
6d32503
Updated AWS Elasticache IAM Connection Example (#2702)
NickG123 May 3, 2023
ffb2b83
pinning urllib3 to fix CI (#2748)
chayim May 7, 2023
3748a8b
Add RedisCluster.remap_host_port, Update tests for CWE 404 (#2706)
kristjanvalur May 7, 2023
906e413
Update redismodules.rst (#2747)
cristianmatache May 8, 2023
cfdcfd8
Add support for cluster myshardid (#2704)
SoulPancake May 8, 2023
9370711
clean warnings (#2731)
dvora-h May 8, 2023
093232d
fix parse_slowlog_get (#2732)
dvora-h May 8, 2023
c0833f6
Optionally disable disconnects in read_response (#2695)
kristjanvalur May 8, 2023
8c06d67
Add client no-touch (#2745)
aciddust May 8, 2023
984b733
fix create single_connection_client from url (#2752)
dvora-h May 8, 2023
4a4566b
Fix `xadd` allow non negative maxlen (#2739)
aciddust May 8, 2023
f056118
Version 4.5.5 (#2753)
dvora-h May 8, 2023
35b7e09
Kristjan/issue #2754: Add missing argument to SentinelManagedConnecti…
kristjanvalur May 10, 2023
2d9b5ac
support JSON.MERGE Command (#2761)
shacharPash May 16, 2023
db7b9dd
Issue #2749: Remove unnecessary __del__ handlers (#2755)
kristjanvalur May 28, 2023
d95d8a2
Add WITHSCORE to ZRANK (#2758)
bodevone May 28, 2023
4d396f8
Fix JSON.MERGE Summary (#2786)
shacharPash Jun 17, 2023
3cdecc1
Fixed key error in parse_xinfo_stream (#2788)
Smit-Parmar Jun 19, 2023
29dfbb2
insert newline to prevent sphinx from assuming code block (#2796)
bmacphee Jun 20, 2023
2bb7f10
Introduce OutOfMemoryError exception for Redis write command rejectio…
bmacphee Jun 20, 2023
53bed27
Add unit tests for the `connect` method of all Redis connection class…
woutdenolf Jun 23, 2023
4f466d6
Fix dead weakref in sentinel connection causing ReferenceError (#2767…
shahar-lev Jun 23, 2023
abc04b5
chore(documentation): fix redirects and some small cleanups (#2801)
vmihailenco Jun 23, 2023
cecf78b
Add waitaof (#2760)
aciddust Jun 23, 2023
40a769e
Extract abstract async connection class (#2734)
woutdenolf Jun 23, 2023
d25a96b
Fix type hint for retry_on_error in async cluster (#2804)
TheKevJames Jun 23, 2023
04aadd7
Fix CI (#2809)
dvora-h Jun 25, 2023
ab617a1
Support JSON.MSET Command (#2766)
shacharPash Jun 25, 2023
9f50357
Version 4.6.0 (#2810)
dvora-h Jun 25, 2023
53c92dd
Merge branch 'master' into 5.0-master-merge
dvora-h Jul 1, 2023
f47a018
master changes
dvora-h Jul 1, 2023
a67c216
linters
dvora-h Jul 1, 2023
1aa2e8d
fix test_cwe_404 cluster test
dvora-h Jul 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
* Fix incorrect redis.asyncio.Cluster type hint for `retry_on_error`
* Fix dead weakref in sentinel connection causing ReferenceError (#2767)
* Fix #2768, Fix KeyError: 'first-entry' in parse_xinfo_stream.
* Fix #2749, remove unnecessary __del__ logic to close connections.
* Fix #2754, adding a missing argument to SentinelManagedConnection
* Fix `xadd` command to accept non-negative `maxlen` including 0
* Revert #2104, #2673, add `disconnect_on_error` option to `read_response()` (issues #2506, #2624)
* Add `address_remap` parameter to `RedisCluster`
* Fix incorrect usage of once flag in async Sentinel
* asyncio: Fix memory leak caused by hiredis (#2693)
* Allow data to drain from async PythonParser when reading during a disconnect()
* Use asyncio.timeout() instead of async_timeout.timeout() for python >= 3.11 (#2602)
* Add test and fix async HiredisParser when reading during a disconnect() (#2349)
Expand Down Expand Up @@ -40,6 +50,8 @@
* Fix Sentinel.execute_command doesn't execute across the entire sentinel cluster bug (#2458)
* Added a replacement for the default cluster node in the event of failure (#2463)
* Fix for Unhandled exception related to self.host with unix socket (#2496)
* Improve error output for master discovery
* Make `ClusterCommandsProtocol` an actual Protocol

* 4.1.3 (Feb 8, 2022)
* Fix flushdb and flushall (#1926)
Expand Down
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

## Introduction

First off, thank you for considering contributing to redis-py. We value
community contributions!
We appreciate your interest in considering contributing to redis-py.
Community contributions mean a lot to us.

## Contributions We Need
## Contributions we need

You may already know what you want to contribute \-- a fix for a bug you
You may already know how you'd like to contribute, whether it's a fix for a bug you
encountered, or a new feature your team wants to use.

If you don't know what to contribute, keep an open mind! Improving
If you don't know where to start, consider improving
documentation, bug triaging, and writing tutorials are all examples of
helpful contributions that mean less work for you.

Expand Down Expand Up @@ -166,19 +166,19 @@ When filing an issue, make sure to answer these five questions:
4. What did you expect to see?
5. What did you see instead?

## How to Suggest a Feature or Enhancement
## Suggest a feature or enhancement

If you'd like to contribute a new feature, make sure you check our
issue list to see if someone has already proposed it. Work may already
be under way on the feature you want -- or we may have rejected a
be underway on the feature you want or we may have rejected a
feature like it already.

If you don't see anything, open a new issue that describes the feature
you would like and how it should work.

## Code Review Process
## Code review process

The core team looks at Pull Requests on a regular basis. We will give
feedback as as soon as possible. After feedback, we expect a response
The core team regularly looks at pull requests. We will provide
feedback as as soon as possible. After receiving our feedback, please respond
within two weeks. After that time, we may close your PR if it isn't
showing any activity.
56 changes: 44 additions & 12 deletions docs/examples/connection_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -267,28 +267,60 @@
}
],
"source": [
"from typing import Tuple, Union\n",
"from urllib.parse import ParseResult, urlencode, urlunparse\n",
"\n",
"import botocore.session\n",
"import redis\n",
"import boto3\n",
"import cachetools.func\n",
"from botocore.model import ServiceId\n",
"from botocore.signers import RequestSigner\n",
"from cachetools import TTLCache, cached\n",
"\n",
"class ElastiCacheIAMProvider(redis.CredentialProvider):\n",
" def __init__(self, user, endpoint, port=6379, region=\"us-east-1\"):\n",
" self.ec_client = boto3.client('elasticache')\n",
" def __init__(self, user, cluster_name, region=\"us-east-1\"):\n",
" self.user = user\n",
" self.endpoint = endpoint\n",
" self.port = port\n",
" self.cluster_name = cluster_name\n",
" self.region = region\n",
"\n",
" session = botocore.session.get_session()\n",
" self.request_signer = RequestSigner(\n",
" ServiceId(\"elasticache\"),\n",
" self.region,\n",
" \"elasticache\",\n",
" \"v4\",\n",
" session.get_credentials(),\n",
" session.get_component(\"event_emitter\"),\n",
" )\n",
"\n",
" # Generated IAM tokens are valid for 15 minutes\n",
" @cached(cache=TTLCache(maxsize=128, ttl=900))\n",
" def get_credentials(self) -> Union[Tuple[str], Tuple[str, str]]:\n",
" @cachetools.func.ttl_cache(maxsize=128, ttl=15 * 60) # 15m\n",
" def get_iam_auth_token(user, endpoint, port, region):\n",
" return self.ec_client.generate_iam_auth_token(user, endpoint, port, region)\n",
" iam_auth_token = get_iam_auth_token(self.endpoint, self.port, self.user, self.region)\n",
" return iam_auth_token\n",
" query_params = {\"Action\": \"connect\", \"User\": self.user}\n",
" url = urlunparse(\n",
" ParseResult(\n",
" scheme=\"https\",\n",
" netloc=self.cluster_name,\n",
" path=\"/\",\n",
" query=urlencode(query_params),\n",
" params=\"\",\n",
" fragment=\"\",\n",
" )\n",
" )\n",
" signed_url = self.request_signer.generate_presigned_url(\n",
" {\"method\": \"GET\", \"url\": url, \"body\": {}, \"headers\": {}, \"context\": {}},\n",
" operation_name=\"connect\",\n",
" expires_in=900,\n",
" region_name=self.region,\n",
" )\n",
" # RequestSigner only seems to work if the URL has a protocol, but\n",
" # Elasticache only accepts the URL without a protocol\n",
" # So strip it off the signed URL before returning\n",
" return (self.user, signed_url.removeprefix(\"https://\"))\n",
"\n",
"username = \"barshaul\"\n",
"cluster_name = \"test-001\"\n",
"endpoint = \"test-001.use1.cache.amazonaws.com\"\n",
"creds_provider = ElastiCacheIAMProvider(user=username, endpoint=endpoint)\n",
"creds_provider = ElastiCacheIAMProvider(user=username, cluster_name=cluster_name)\n",
"user_connection = redis.Redis(host=endpoint, port=6379, credential_provider=creds_provider)\n",
"user_connection.ping()"
]
Expand Down
3 changes: 1 addition & 2 deletions docs/examples/opentelemetry/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

import time

import redis
import uptrace
from opentelemetry import trace
from opentelemetry.instrumentation.redis import RedisInstrumentor

import redis

tracer = trace.get_tracer("app_or_package_name", "1.0.0")


Expand Down
Loading