Skip to content

Commit

Permalink
Enhanced the generator to omit generating default parameter values wh…
Browse files Browse the repository at this point in the history
…en they are already specified in the parameter description.

Signed-off-by: saimedhi <saimedhi@amazon.com>
  • Loading branch information
saimedhi committed Apr 22, 2024
1 parent 083d522 commit f7908f9
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Fixed
- Updated code generator to use native OpenAPI specification ([#721](https://github.com/opensearch-project/opensearch-py/pull/721))
### Updated APIs
- Updated opensearch-py APIs to reflect [opensearch-api-specification@61f8a38](https://github.com/opensearch-project/opensearch-api-specification/commit/61f8a382c6abc7d9bb0504a097b52323809095be)
- Updated opensearch-py APIs to reflect [opensearch-api-specification@e02c076](https://github.com/opensearch-project/opensearch-api-specification/commit/e02c076ef63f7a9b650ca1416380120cc640620a)
- Updated opensearch-py APIs to reflect [opensearch-api-specification@fe6f977](https://github.com/opensearch-project/opensearch-api-specification/commit/fe6f977bcae4e27a2b261fb9599884df5606c0bc)
- Updated opensearch-py APIs to reflect [opensearch-api-specification@29faff0](https://github.com/opensearch-project/opensearch-api-specification/commit/29faff0709b2557acfd4c3c7e053a2c313413633)
Expand Down
4 changes: 2 additions & 2 deletions opensearchpy/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ async def delete_by_query(
`open`, `closed`, `hidden`, `none`.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg from_: Starting offset (default: 0) Default is 0.
:arg from_: Starting offset (default: 0)
:arg human: Whether to return human readable values for
statistics.
:arg ignore_unavailable: If `false`, the request returns an
Expand Down Expand Up @@ -2765,7 +2765,7 @@ async def update_by_query(
`closed`, `hidden`, `none`.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg from_: Starting offset (default: 0) Default is 0.
:arg from_: Starting offset (default: 0)
:arg human: Whether to return human readable values for
statistics.
:arg ignore_unavailable: If `false`, the request returns an
Expand Down
6 changes: 3 additions & 3 deletions opensearchpy/_async/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ async def state(
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flat_settings: Return settings in flat format (default:
false) Default is false.
false)
:arg human: Whether to return human readable values for
statistics.
:arg ignore_unavailable: Whether specified concrete indices
should be ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state
from cluster-manager node (default: false) Default is false.
from cluster-manager node (default: false)
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Specify timeout for connection
to master
Expand Down Expand Up @@ -438,7 +438,7 @@ async def put_settings(
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flat_settings: Return settings in flat format (default:
false) Default is false.
false)
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
Expand Down
6 changes: 3 additions & 3 deletions opensearchpy/_async/client/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,11 +1214,11 @@ async def exists_template(
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flat_settings: Return settings in flat format (default:
false) Default is false.
false)
:arg human: Whether to return human readable values for
statistics.
:arg local: Return local information, do not retrieve the state
from cluster-manager node (default: false) Default is false.
from cluster-manager node (default: false)
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
Expand Down Expand Up @@ -1970,7 +1970,7 @@ async def forcemerge(
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flush: Specify whether the index should be flushed after
performing the operation (default: true) Default is True.
performing the operation (default: true)
:arg human: Whether to return human readable values for
statistics.
:arg ignore_unavailable: Whether specified concrete indices
Expand Down
2 changes: 1 addition & 1 deletion opensearchpy/_async/client/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ async def get_repository(
:arg human: Whether to return human readable values for
statistics.
:arg local: Return local information, do not retrieve the state
from cluster-manager node (default: false) Default is false.
from cluster-manager node (default: false)
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
Expand Down
4 changes: 2 additions & 2 deletions opensearchpy/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ def delete_by_query(
`open`, `closed`, `hidden`, `none`.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg from_: Starting offset (default: 0) Default is 0.
:arg from_: Starting offset (default: 0)
:arg human: Whether to return human readable values for
statistics.
:arg ignore_unavailable: If `false`, the request returns an
Expand Down Expand Up @@ -2765,7 +2765,7 @@ def update_by_query(
`closed`, `hidden`, `none`.
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg from_: Starting offset (default: 0) Default is 0.
:arg from_: Starting offset (default: 0)
:arg human: Whether to return human readable values for
statistics.
:arg ignore_unavailable: If `false`, the request returns an
Expand Down
6 changes: 3 additions & 3 deletions opensearchpy/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ def state(
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flat_settings: Return settings in flat format (default:
false) Default is false.
false)
:arg human: Whether to return human readable values for
statistics.
:arg ignore_unavailable: Whether specified concrete indices
should be ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state
from cluster-manager node (default: false) Default is false.
from cluster-manager node (default: false)
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Specify timeout for connection
to master
Expand Down Expand Up @@ -438,7 +438,7 @@ def put_settings(
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flat_settings: Return settings in flat format (default:
false) Default is false.
false)
:arg human: Whether to return human readable values for
statistics.
:arg master_timeout (Deprecated: To promote inclusive language,
Expand Down
6 changes: 3 additions & 3 deletions opensearchpy/client/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,11 +1214,11 @@ def exists_template(
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flat_settings: Return settings in flat format (default:
false) Default is false.
false)
:arg human: Whether to return human readable values for
statistics.
:arg local: Return local information, do not retrieve the state
from cluster-manager node (default: false) Default is false.
from cluster-manager node (default: false)
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
Expand Down Expand Up @@ -1970,7 +1970,7 @@ def forcemerge(
:arg filter_path: Comma-separated list of filters used to reduce
the response.
:arg flush: Specify whether the index should be flushed after
performing the operation (default: true) Default is True.
performing the operation (default: true)
:arg human: Whether to return human readable values for
statistics.
:arg ignore_unavailable: Whether specified concrete indices
Expand Down
2 changes: 1 addition & 1 deletion opensearchpy/client/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def get_repository(
:arg human: Whether to return human readable values for
statistics.
:arg local: Return local information, do not retrieve the state
from cluster-manager node (default: false) Default is false.
from cluster-manager node (default: false)
:arg master_timeout (Deprecated: To promote inclusive language,
use 'cluster_manager_timeout' instead.): Explicit operation timeout for
connection to master node
Expand Down
2 changes: 1 addition & 1 deletion utils/templates/base
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{% if info.description %}
{% filter wordwrap(72, wrapstring="\n ") %}
:arg {{ p }}{% if info.deprecated and info.deprecation_message is defined %} (Deprecated: {{ info['deprecation_message'][:-1] }}.){% endif %}: {{ info.description }} {% if info.options and "Valid values" not in info.description %}Valid choices are {{ info.options|join(", ") }}.{% endif %}
{% if info.default is defined %}{% if info.default is not none %}{% if info.default is sameas(false) %}Default is false.{% else %}Default is {{ info.default }}.{% endif %}{% endif %}{% endif %}
{% if info.default is defined %}{% if info.default is not none and "default:" not in info.description%}{% if info.default is sameas(false) %}Default is false.{% else %}Default is {{ info.default }}.{% endif %}{% endif %}{% endif %}
{% endfilter %}

{% endif %}
Expand Down

0 comments on commit f7908f9

Please sign in to comment.