From acbbdd2d0a419e8e39e6d8f7949101c97373c542 Mon Sep 17 00:00:00 2001 From: Morten Hauberg Date: Fri, 20 Mar 2020 14:21:11 +0100 Subject: [PATCH] Remove duplicate arguments in docstrings --- elasticsearch/client/__init__.py | 6 +----- elasticsearch/client/cat.py | 8 ++------ elasticsearch/client/indices.py | 3 --- elasticsearch/client/watcher.py | 3 --- utils/generate_api.py | 9 ++++++--- 5 files changed, 9 insertions(+), 20 deletions(-) diff --git a/elasticsearch/client/__init__.py b/elasticsearch/client/__init__.py index 7b4568ed..68f9dbb9 100644 --- a/elasticsearch/client/__init__.py +++ b/elasticsearch/client/__init__.py @@ -434,8 +434,6 @@ class Elasticsearch(object): 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 @@ -1293,7 +1291,6 @@ class Elasticsearch(object): :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 @@ -1452,12 +1449,11 @@ class Elasticsearch(object): :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.") diff --git a/elasticsearch/client/cat.py b/elasticsearch/client/cat.py index 6c4ae760..2cb15848 100644 --- a/elasticsearch/client/cat.py +++ b/elasticsearch/client/cat.py @@ -243,8 +243,6 @@ class CatClient(NamespacedClient): 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 @@ -371,12 +369,10 @@ class CatClient(NamespacedClient): node in the cluster. ``_ - :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 diff --git a/elasticsearch/client/indices.py b/elasticsearch/client/indices.py index 4e42e6da..b2949c61 100644 --- a/elasticsearch/client/indices.py +++ b/elasticsearch/client/indices.py @@ -12,7 +12,6 @@ class IndicesClient(NamespacedClient): :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", @@ -918,8 +917,6 @@ class IndicesClient(NamespacedClient): 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 """ diff --git a/elasticsearch/client/watcher.py b/elasticsearch/client/watcher.py index 591d0abc..43c88597 100644 --- a/elasticsearch/client/watcher.py +++ b/elasticsearch/client/watcher.py @@ -149,9 +149,6 @@ class WatcherClient(NamespacedClient): 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", diff --git a/utils/generate_api.py b/utils/generate_api.py index 183934e4..26a4b950 100644 --- a/utils/generate_api.py +++ b/utils/generate_api.py @@ -171,11 +171,14 @@ class API: @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