Skip to content

Commit acbbdd2

Browse files
Remove duplicate arguments in docstrings
1 parent 07bb2c7 commit acbbdd2

File tree

5 files changed

+9
-20
lines changed

5 files changed

+9
-20
lines changed

elasticsearch/client/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,6 @@ def bulk(self, body, index=None, doc_type=None, params=None, headers=None):
434434
the returned _source field, can be overridden on each sub-request
435435
:arg _source_includes: Default list of fields to extract and
436436
return from the _source field, can be overridden on each sub-request
437-
:arg doc_type: Default document type for items which don't
438-
provide one
439437
:arg pipeline: The pipeline id to preprocess incoming documents
440438
with
441439
:arg refresh: If `true` then refresh the affected shards to make
@@ -1293,7 +1291,6 @@ def put_script(self, id, body, context=None, params=None, headers=None):
12931291
12941292
:arg id: Script ID
12951293
:arg body: The document
1296-
:arg context: Script context
12971294
:arg context: Context name to compile script against
12981295
:arg master_timeout: Specify timeout for connection to master
12991296
:arg timeout: Explicit operation timeout
@@ -1452,12 +1449,11 @@ def scroll(self, body=None, scroll_id=None, params=None, headers=None):
14521449
14531450
:arg body: The scroll ID if not passed by URL or query
14541451
parameter.
1455-
:arg scroll_id: The scroll ID
1452+
:arg scroll_id: The scroll ID for scrolled search
14561453
:arg rest_total_hits_as_int: Indicates whether hits.total should
14571454
be rendered as an integer or an object in the rest search response
14581455
:arg scroll: Specify how long a consistent view of the index
14591456
should be maintained for scrolled search
1460-
:arg scroll_id: The scroll ID for scrolled search
14611457
"""
14621458
if scroll_id in SKIP_IN_PATH and body in SKIP_IN_PATH:
14631459
raise ValueError("You need to supply scroll_id or body.")

elasticsearch/client/cat.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,6 @@ def recovery(self, index=None, params=None, headers=None):
243243
yaml
244244
:arg h: Comma-separated list of column names to display
245245
:arg help: Return help information
246-
:arg index: Comma-separated list or wildcard expression of index
247-
names to limit the returned information
248246
:arg s: Comma-separated list of column names or column aliases
249247
to sort by
250248
:arg time: The unit in which to display time values Valid
@@ -371,12 +369,10 @@ def fielddata(self, fields=None, params=None, headers=None):
371369
node in the cluster.
372370
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html>`_
373371
374-
:arg fields: A comma-separated list of fields to return the
375-
fielddata size
376-
:arg bytes: The unit in which to display byte values Valid
377-
choices: b, k, kb, m, mb, g, gb, t, tb, p, pb
378372
:arg fields: A comma-separated list of fields to return in the
379373
output
374+
:arg bytes: The unit in which to display byte values Valid
375+
choices: b, k, kb, m, mb, g, gb, t, tb, p, pb
380376
:arg format: a short version of the Accept header, e.g. json,
381377
yaml
382378
:arg h: Comma-separated list of column names to display

elasticsearch/client/indices.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ def analyze(self, body=None, index=None, params=None, headers=None):
1212
:arg body: Define analyzer/tokenizer parameters and the text on
1313
which the analysis should be performed
1414
:arg index: The name of the index to scope the operation
15-
:arg index: The name of the index to scope the operation
1615
"""
1716
return self.transport.perform_request(
1817
"POST",
@@ -918,8 +917,6 @@ def clear_cache(self, index=None, params=None, headers=None):
918917
using the `fielddata` parameter (default: all)
919918
:arg ignore_unavailable: Whether specified concrete indices
920919
should be ignored when unavailable (missing or closed)
921-
:arg index: A comma-separated list of index name to limit the
922-
operation
923920
:arg query: Clear query caches
924921
:arg request: Clear request cache
925922
"""

elasticsearch/client/watcher.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ def stats(self, metric=None, params=None, headers=None):
149149
current_watches, pending_watches
150150
:arg emit_stacktraces: Emits stack traces of currently running
151151
watches
152-
:arg metric: Controls what additional stat metrics should be
153-
include in the response Valid choices: _all, queued_watches,
154-
current_watches, pending_watches
155152
"""
156153
return self.transport.perform_request(
157154
"GET",

utils/generate_api.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,14 @@ def ind(item):
171171
@property
172172
def params(self):
173173
parts = self.all_parts
174+
params = self._def.get("params", {})
174175
return chain(
175176
((p, parts[p]) for p in parts if parts[p]["required"]),
176-
(("body", self.body), ) if self.body else (),
177-
((p, parts[p]) for p in parts if not parts[p]["required"]),
178-
sorted(self._def.get("params", {}).items()),
177+
(("body", self.body),) if self.body else (),
178+
((p, parts[p]) for p in parts
179+
if not parts[p]["required"] and
180+
p not in params),
181+
sorted(params.items(), key=lambda x: (x[0] not in parts, x[0])),
179182
)
180183

181184
@property

0 commit comments

Comments
 (0)