Skip to content

Commit

Permalink
fix: Update RedisCluster to use redis-py official implementation (#2554)
Browse files Browse the repository at this point in the history
* switch to using redis cluster in redis-py

Signed-off-by: Kevin Zhang <kzhang@tecton.ai>

* fix

Signed-off-by: Kevin Zhang <kzhang@tecton.ai>

* Fix

Signed-off-by: Kevin Zhang <kzhang@tecton.ai>

* Fix dependencies

Signed-off-by: Kevin Zhang <kzhang@tecton.ai>

* Update py3.7-ci-requirements.txt

Signed-off-by: Felix Wang <wangfelix98@gmail.com>

* update 3.10 requirements

Signed-off-by: Kevin Zhang <kzhang@tecton.ai>

* Fix dependencies to address issues

Signed-off-by: Kevin Zhang <kzhang@tecton.ai>

* Fix

Signed-off-by: Kevin Zhang <kzhang@tecton.ai>

* Fix

Signed-off-by: Kevin Zhang <kzhang@tecton.ai>

Co-authored-by: Felix Wang <wangfelix98@gmail.com>
  • Loading branch information
kevjumba and felixwang9817 authored Apr 15, 2022
1 parent 753bd88 commit ce5606f
Show file tree
Hide file tree
Showing 9 changed files with 425 additions and 685 deletions.
6 changes: 4 additions & 2 deletions sdk/python/feast/infra/online_stores/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

try:
from redis import Redis
from rediscluster import RedisCluster
from redis.cluster import ClusterNode, RedisCluster
except ImportError as e:
from feast.errors import FeastExtrasDependencyImportError

Expand Down Expand Up @@ -164,7 +164,9 @@ def _get_client(self, online_store_config: RedisOnlineStoreConfig):
online_store_config.connection_string
)
if online_store_config.redis_type == RedisType.redis_cluster:
kwargs["startup_nodes"] = startup_nodes
kwargs["startup_nodes"] = [
ClusterNode(**node) for node in startup_nodes
]
self._client = RedisCluster(**kwargs)
else:
kwargs["host"] = startup_nodes[0]["host"]
Expand Down
Loading

0 comments on commit ce5606f

Please sign in to comment.