Skip to content

Commit e1870d9

Browse files
authored
Properly escape underscore in from_ parameter docs
1 parent 6145e23 commit e1870d9

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

elasticsearch/client/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ def delete_by_query(self, index, body, params=None, headers=None):
668668
:arg expand_wildcards: Whether to expand wildcard expression to
669669
concrete indices that are open, closed or both. Valid choices: open,
670670
closed, hidden, none, all Default: open
671-
:arg from_: Starting offset (default: 0)
671+
:arg from\\_: Starting offset (default: 0)
672672
:arg ignore_unavailable: Whether specified concrete indices
673673
should be ignored when unavailable (missing or closed)
674674
:arg lenient: Specify whether format-based query failures (such
@@ -1423,7 +1423,7 @@ def search(self, body=None, index=None, params=None, headers=None):
14231423
closed, hidden, none, all Default: open
14241424
:arg explain: Specify whether to return detailed information
14251425
about score computation as part of a hit
1426-
:arg from_: Starting offset (default: 0)
1426+
:arg from\\_: Starting offset (default: 0)
14271427
:arg ignore_throttled: Whether specified concrete, expanded or
14281428
aliased indices should be ignored when throttled
14291429
:arg ignore_unavailable: Whether specified concrete indices
@@ -1922,7 +1922,7 @@ def update_by_query(self, index, body=None, params=None, headers=None):
19221922
:arg expand_wildcards: Whether to expand wildcard expression to
19231923
concrete indices that are open, closed or both. Valid choices: open,
19241924
closed, hidden, none, all Default: open
1925-
:arg from_: Starting offset (default: 0)
1925+
:arg from\\_: Starting offset (default: 0)
19261926
:arg ignore_unavailable: Whether specified concrete indices
19271927
should be ignored when unavailable (missing or closed)
19281928
:arg lenient: Specify whether format-based query failures (such

elasticsearch/client/async_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def submit(self, body=None, index=None, params=None, headers=None):
125125
closed, hidden, none, all Default: open
126126
:arg explain: Specify whether to return detailed information
127127
about score computation as part of a hit
128-
:arg from_: Starting offset (default: 0)
128+
:arg from\\_: Starting offset (default: 0)
129129
:arg ignore_throttled: Whether specified concrete, expanded or
130130
aliased indices should be ignored when throttled
131131
:arg ignore_unavailable: Whether specified concrete indices

elasticsearch/client/cat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ def ml_trained_models(self, model_id=None, params=None, headers=None):
653653
choices: b, k, kb, m, mb, g, gb, t, tb, p, pb
654654
:arg format: a short version of the Accept header, e.g. json,
655655
yaml
656-
:arg from_: skips a number of trained models
656+
:arg from\\_: skips a number of trained models
657657
:arg h: Comma-separated list of column names to display
658658
:arg help: Return help information
659659
:arg s: Comma-separated list of column names or column aliases
@@ -690,7 +690,7 @@ def transforms(self, transform_id=None, params=None, headers=None):
690690
transforms have been specified)
691691
:arg format: a short version of the Accept header, e.g. json,
692692
yaml
693-
:arg from_: skips a number of transform configs, defaults to 0
693+
:arg from\\_: skips a number of transform configs, defaults to 0
694694
:arg h: Comma-separated list of column names to display
695695
:arg help: Return help information
696696
:arg s: Comma-separated list of column names or column aliases

elasticsearch/client/ml.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def get_buckets(self, job_id, body=None, timestamp=None, params=None, headers=No
352352
:arg end: End time filter for buckets
353353
:arg exclude_interim: Exclude interim results
354354
:arg expand: Include anomaly records
355-
:arg from_: skips a number of buckets
355+
:arg from\\_: skips a number of buckets
356356
:arg size: specifies a max number of buckets to get
357357
:arg sort: Sort buckets by a particular field
358358
:arg start: Start time filter for buckets
@@ -382,7 +382,7 @@ def get_calendar_events(self, calendar_id, params=None, headers=None):
382382
383383
:arg calendar_id: The ID of the calendar containing the events
384384
:arg end: Get events before this time
385-
:arg from_: Skips a number of events
385+
:arg from\\_: Skips a number of events
386386
:arg job_id: Get events for the job. When this option is used
387387
calendar_id must be '_all'
388388
:arg size: Specifies a max number of events to get
@@ -413,7 +413,7 @@ def get_calendars(self, body=None, calendar_id=None, params=None, headers=None):
413413
:arg body: The from and size parameters optionally sent in the
414414
body
415415
:arg calendar_id: The ID of the calendar to fetch
416-
:arg from_: skips a number of calendars
416+
:arg from\\_: skips a number of calendars
417417
:arg size: specifies a max number of calendars to get
418418
"""
419419
# from is a reserved word so it cannot be used, use from_ instead
@@ -471,7 +471,7 @@ def get_filters(self, filter_id=None, params=None, headers=None):
471471
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-filter.html>`_
472472
473473
:arg filter_id: The ID of the filter to fetch
474-
:arg from_: skips a number of filters
474+
:arg from\\_: skips a number of filters
475475
:arg size: specifies a max number of filters to get
476476
"""
477477
# from is a reserved word so it cannot be used, use from_ instead
@@ -506,7 +506,7 @@ def get_influencers(self, job_id, body=None, params=None, headers=None):
506506
order
507507
:arg end: end timestamp for the requested influencers
508508
:arg exclude_interim: Exclude interim results
509-
:arg from_: skips a number of influencers
509+
:arg from\\_: skips a number of influencers
510510
:arg influencer_score: influencer score threshold for the
511511
requested influencers
512512
:arg size: specifies a max number of influencers to get
@@ -632,7 +632,7 @@ def get_records(self, job_id, body=None, params=None, headers=None):
632632
:arg desc: Set the sort direction
633633
:arg end: End time filter for records
634634
:arg exclude_interim: Exclude interim results
635-
:arg from_: skips a number of records
635+
:arg from\\_: skips a number of records
636636
:arg record_score: Returns records with anomaly scores greater
637637
or equal than this value
638638
:arg size: specifies a max number of records to get
@@ -1092,7 +1092,7 @@ def get_data_frame_analytics(self, id=None, params=None, headers=None):
10921092
:arg allow_no_match: Whether to ignore if a wildcard expression
10931093
matches no data frame analytics. (This includes `_all` string or when no
10941094
data frame analytics have been specified) Default: True
1095-
:arg from_: skips a number of analytics
1095+
:arg from\\_: skips a number of analytics
10961096
:arg size: specifies a max number of analytics to get Default:
10971097
100
10981098
"""
@@ -1117,7 +1117,7 @@ def get_data_frame_analytics_stats(self, id=None, params=None, headers=None):
11171117
:arg allow_no_match: Whether to ignore if a wildcard expression
11181118
matches no data frame analytics. (This includes `_all` string or when no
11191119
data frame analytics have been specified) Default: True
1120-
:arg from_: skips a number of analytics
1120+
:arg from\\_: skips a number of analytics
11211121
:arg size: specifies a max number of analytics to get Default:
11221122
100
11231123
"""
@@ -1241,7 +1241,7 @@ def get_trained_models(self, model_id=None, params=None, headers=None):
12411241
:arg decompress_definition: Should the model definition be
12421242
decompressed into valid JSON or returned in a custom compressed format.
12431243
Defaults to true. Default: True
1244-
:arg from_: skips a number of trained models
1244+
:arg from\\_: skips a number of trained models
12451245
:arg include_model_definition: Should the full model definition
12461246
be included in the results. These definitions can be large. So be
12471247
cautious when including them. Defaults to false.
@@ -1271,7 +1271,7 @@ def get_trained_models_stats(self, model_id=None, params=None, headers=None):
12711271
:arg allow_no_match: Whether to ignore if a wildcard expression
12721272
matches no trained models. (This includes `_all` string or when no
12731273
trained models have been specified) Default: True
1274-
:arg from_: skips a number of trained models
1274+
:arg from\\_: skips a number of trained models
12751275
:arg size: specifies a max number of trained models to get
12761276
Default: 100
12771277
"""
@@ -1358,7 +1358,7 @@ def get_categories(
13581358
:arg body: Category selection details if not provided in URI
13591359
:arg category_id: The identifier of the category definition of
13601360
interest
1361-
:arg from_: skips a number of categories
1361+
:arg from\\_: skips a number of categories
13621362
:arg size: specifies a max number of categories to get
13631363
"""
13641364
# from is a reserved word so it cannot be used, use from_ instead
@@ -1392,7 +1392,7 @@ def get_model_snapshots(
13921392
:arg desc: True if the results should be sorted in descending
13931393
order
13941394
:arg end: The filter 'end' query parameter
1395-
:arg from_: Skips a number of documents
1395+
:arg from\\_: Skips a number of documents
13961396
:arg size: The default number of documents returned in queries
13971397
as a string.
13981398
:arg sort: Name of the field to sort on

elasticsearch/client/transform.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def get_transform(self, transform_id=None, params=None, headers=None):
4141
:arg allow_no_match: Whether to ignore if a wildcard expression
4242
matches no transforms. (This includes `_all` string or when no
4343
transforms have been specified)
44-
:arg from_: skips a number of transform configs, defaults to 0
44+
:arg from\\_: skips a number of transform configs, defaults to 0
4545
:arg size: specifies a max number of transforms to get, defaults
4646
to 100
4747
"""
@@ -67,7 +67,7 @@ def get_transform_stats(self, transform_id, params=None, headers=None):
6767
:arg allow_no_match: Whether to ignore if a wildcard expression
6868
matches no transforms. (This includes `_all` string or when no
6969
transforms have been specified)
70-
:arg from_: skips a number of transform stats, defaults to 0
70+
:arg from\\_: skips a number of transform stats, defaults to 0
7171
:arg size: specifies a max number of transform stats to get,
7272
defaults to 100
7373
"""

utils/templates/base

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
{% for p, info in api.params %}
1414
{% filter wordwrap(72, wrapstring="\n ") %}
15-
:arg {{ p }}: {{ info.description }} {% if info.options %} Valid choices: {{ info.options|join(", ") }}{% endif %} {% if info.default %} Default: {{ info.default }}{% endif %}
15+
:arg {{ 'from\\\\_' if p == 'from_' else p }}: {{ info.description }} {% if info.options %} Valid choices: {{ info.options|join(", ") }}{% endif %} {% if info.default %} Default: {{ info.default }}{% endif %}
1616
{% endfilter %}
1717

1818
{% endfor %}

0 commit comments

Comments
 (0)