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

Restore default metric='_all' to cluster.state() #1143

Merged
merged 6 commits into from Mar 10, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions elasticsearch/client/cluster.py
Expand Up @@ -102,6 +102,9 @@ def state(self, metric=None, index=None, params=None):
:arg wait_for_timeout: The maximum time to wait for
wait_for_metadata_version before timing out
"""
if index and not metric:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think just for consistency we might want to check against SKIP_IN_PATH instead of just the bool value. It amounts to the same thing in this case pretty much but would probably be better

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah agreed.

metric = "_all"

return self.transport.perform_request(
"GET", _make_path("_cluster", "state", metric, index), params=params
)
Expand Down
8 changes: 8 additions & 0 deletions utils/templates/overrides/cluster/state
@@ -0,0 +1,8 @@
{% extends "base" %}
{% block request %}
if index and not metric:
metric = "_all"

{{ super()|trim }}
{% endblock %}