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

added possible Tuple timeout for Config #897

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

LGXerxes
Copy link

No description provided.

Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a464d39) 100.00% compared to head (3721b49) 100.00%.
Report is 18 commits behind head on main.

❗ Current head 3721b49 differs from pull request most recent head d540bf2. Consider uploading reports for the commit d540bf2 to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #897   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        13           
  Lines          752       748    -4     
=========================================
- Hits           752       748    -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@curquiza
Copy link
Member

Thank you @LGXerxes for your PR

@sanders41 if you have the time to review (never an emergency). Looks too python-oriented for me 😅

Copy link
Collaborator

@sanders41 sanders41 left a comment

Choose a reason for hiding this comment

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

This same change will also need to be made to the timeout in the __init__ of the Client class. Additionally the doc string for the Client class should be updated to explain the Tuple options.

There is a test in tests/client/test_client.py called test_client_timeout_set that should be updated to verify all these options work. That test can be parametrized to cover the options:

@pytest.mark.parametrize("timeout", (5, 5.0, (5, 5), (5.0, 5.0)))
def test_client_timeout_set(timeout):
    client = meilisearch.Client(BASE_URL, MASTER_KEY, timeout=timeout)
    response = client.health()
    assert client.config.timeout == timeout
    assert response["status"] == "available"

meilisearch/config.py Outdated Show resolved Hide resolved
LGXerxes and others added 2 commits February 2, 2024 15:38
Co-authored-by: Paul Sanders <psanders1@gmail.com>
Copy link
Collaborator

@sanders41 sanders41 left a comment

Choose a reason for hiding this comment

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

This change looks good. We still need the same change to be made to the timeout in the __init__ of the Client class, and the doc string for the Client class should be updated to explain the Tuple options. Additionally the test update is still needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants