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 SEARCH commands in cluster #2042

Merged
merged 3 commits into from Mar 14, 2022

Conversation

dvora-h
Copy link
Collaborator

@dvora-h dvora-h commented Mar 9, 2022

Pull Request check-list

Please make sure to review and check all of these items:

  • Does $ tox pass with this change (including linting)?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?
  • Was the change added to CHANGES file?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

Please provide a description of the change here.

@dvora-h dvora-h added the feature New feature label Mar 9, 2022
@codecov-commenter
Copy link

codecov-commenter commented Mar 10, 2022

Codecov Report

Merging #2042 (843064a) into master (1f2259f) will increase coverage by 0.02%.
The diff coverage is 96.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2042      +/-   ##
==========================================
+ Coverage   92.17%   92.19%   +0.02%     
==========================================
  Files         100      100              
  Lines       20998    21027      +29     
==========================================
+ Hits        19355    19386      +31     
+ Misses       1643     1641       -2     
Impacted Files Coverage Δ
redis/cluster.py 91.82% <83.33%> (-0.11%) ⬇️
tests/conftest.py 88.40% <100.00%> (+0.80%) ⬆️
tests/test_search.py 99.13% <100.00%> (+0.01%) ⬆️
redis/commands/search/commands.py 89.02% <0.00%> (-0.22%) ⬇️
redis/asyncio/connection.py 82.88% <0.00%> (+0.23%) ⬆️
redis/commands/search/__init__.py 85.00% <0.00%> (+3.18%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1f2259f...843064a. Read the comment docs.

@@ -318,6 +318,42 @@ class RedisCluster(RedisClusterCommands):
),
)

SEARCH_COMMANDS = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we refactor, the way commands like this work are on the table for change.

@@ -183,7 +183,7 @@ def wait_for_cluster_creation(redis_url, cluster_nodes, timeout=60):
while now < end_time:
try:
client = redis.RedisCluster.from_url(redis_url)
if len(client.get_nodes()) == cluster_nodes:
if len(client.get_nodes()) == int(cluster_nodes):
print("All nodes are available!")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this print statement? In general, even in tests, we shouldn't have prints.

@@ -52,13 +48,12 @@ def waitForIndex(env, idx, timeout=None):
break


def getClient():
def getClient(client):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great

@chayim chayim self-requested a review March 10, 2022 08:06
@dvora-h dvora-h merged commit b442110 into redis:master Mar 14, 2022
@dvora-h dvora-h deleted the search-cluster branch May 9, 2022 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants