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

Remove duplicate arguments in documentation #1169

Merged
merged 3 commits into from
Mar 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 1 addition & 5 deletions elasticsearch/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,6 @@ def bulk(self, body, index=None, doc_type=None, params=None, headers=None):
the returned _source field, can be overridden on each sub-request
:arg _source_includes: Default list of fields to extract and
return from the _source field, can be overridden on each sub-request
:arg doc_type: Default document type for items which don't
provide one
:arg pipeline: The pipeline id to preprocess incoming documents
with
:arg refresh: If `true` then refresh the affected shards to make
Expand Down Expand Up @@ -1293,7 +1291,6 @@ def put_script(self, id, body, context=None, params=None, headers=None):

:arg id: Script ID
:arg body: The document
:arg context: Script context
:arg context: Context name to compile script against
:arg master_timeout: Specify timeout for connection to master
:arg timeout: Explicit operation timeout
Expand Down Expand Up @@ -1452,12 +1449,11 @@ def scroll(self, body=None, scroll_id=None, params=None, headers=None):

:arg body: The scroll ID if not passed by URL or query
parameter.
:arg scroll_id: The scroll ID
:arg scroll_id: The scroll ID for scrolled search
:arg rest_total_hits_as_int: Indicates whether hits.total should
be rendered as an integer or an object in the rest search response
:arg scroll: Specify how long a consistent view of the index
should be maintained for scrolled search
:arg scroll_id: The scroll ID for scrolled search
"""
if scroll_id in SKIP_IN_PATH and body in SKIP_IN_PATH:
raise ValueError("You need to supply scroll_id or body.")
Expand Down
8 changes: 2 additions & 6 deletions elasticsearch/client/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,6 @@ def recovery(self, index=None, params=None, headers=None):
yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information
:arg index: Comma-separated list or wildcard expression of index
names to limit the returned information
:arg s: Comma-separated list of column names or column aliases
to sort by
:arg time: The unit in which to display time values Valid
Expand Down Expand Up @@ -371,12 +369,10 @@ def fielddata(self, fields=None, params=None, headers=None):
node in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html>`_

:arg fields: A comma-separated list of fields to return the
fielddata size
:arg bytes: The unit in which to display byte values Valid
choices: b, k, kb, m, mb, g, gb, t, tb, p, pb
:arg fields: A comma-separated list of fields to return in the
output
:arg bytes: The unit in which to display byte values Valid
choices: b, k, kb, m, mb, g, gb, t, tb, p, pb
:arg format: a short version of the Accept header, e.g. json,
yaml
:arg h: Comma-separated list of column names to display
Expand Down
3 changes: 0 additions & 3 deletions elasticsearch/client/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ def analyze(self, body=None, index=None, params=None, headers=None):
:arg body: Define analyzer/tokenizer parameters and the text on
which the analysis should be performed
:arg index: The name of the index to scope the operation
:arg index: The name of the index to scope the operation
"""
return self.transport.perform_request(
"POST",
Expand Down Expand Up @@ -918,8 +917,6 @@ def clear_cache(self, index=None, params=None, headers=None):
using the `fielddata` parameter (default: all)
:arg ignore_unavailable: Whether specified concrete indices
should be ignored when unavailable (missing or closed)
:arg index: A comma-separated list of index name to limit the
operation
:arg query: Clear query caches
:arg request: Clear request cache
"""
Expand Down
3 changes: 0 additions & 3 deletions elasticsearch/client/watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ def stats(self, metric=None, params=None, headers=None):
current_watches, pending_watches
:arg emit_stacktraces: Emits stack traces of currently running
watches
:arg metric: Controls what additional stat metrics should be
include in the response Valid choices: _all, queued_watches,
current_watches, pending_watches
"""
return self.transport.perform_request(
"GET",
Expand Down
9 changes: 6 additions & 3 deletions utils/generate_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,14 @@ def ind(item):
@property
def params(self):
parts = self.all_parts
params = self._def.get("params", {})
return chain(
((p, parts[p]) for p in parts if parts[p]["required"]),
(("body", self.body), ) if self.body else (),
((p, parts[p]) for p in parts if not parts[p]["required"]),
sorted(self._def.get("params", {}).items()),
(("body", self.body),) if self.body else (),
((p, parts[p]) for p in parts
if not parts[p]["required"] and
p not in params),
sorted(params.items(), key=lambda x: (x[0] not in parts, x[0])),
)

@property
Expand Down