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

Add support for CLUSTER SHARDS #2151

Merged
merged 6 commits into from
May 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
linters
  • Loading branch information
dvora-h committed Apr 28, 2022
commit ad780fa04e56cb8553963cebd91450aaa97ae5f8
2 changes: 1 addition & 1 deletion redis/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def parse_cluster_shards(resp, **options):
dict_node[node[i]] = node[i + 1]
shard["nodes"].append(dict_node)
shards.append(shard)

return shards


Expand Down
2 changes: 1 addition & 1 deletion redis/commands/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def cluster_slots(self, target_nodes=None):
For more information see https://redis.io/commands/cluster-slots
"""
return self.execute_command("CLUSTER SLOTS", target_nodes=target_nodes)

def cluster_shards(self, target_nodes=None):
"""
Returns details about the shards of the cluster.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ def test_cluster_shards(self, r):
"tls-port",
"role",
"replication-offset",
"health"
"health",
]
for x in cluster_shards:
assert list(x.keys()) == ["slots", "nodes"]
Expand Down