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 include_type_name parameter from APIs #156

Merged
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
29 changes: 3 additions & 26 deletions opensearchpy/_async/client/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ async def flush(self, index=None, params=None, headers=None):
"POST", _make_path(index, "_flush"), params=params, headers=headers
)

@query_params(
"include_type_name", "master_timeout", "timeout", "wait_for_active_shards"
)
@query_params("master_timeout", "timeout", "wait_for_active_shards")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we are working on this, is there a plan to work on inclusive naming for clients?
I've opened up an issue as I didn't see one: opensearch-project/opensearch-clients#16

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inclusive naming changes will be done once the breaking changes are in for the clients. I will add a reference to this issue in the original meta issue.

async def create(self, index, body=None, params=None, headers=None):
"""
Creates an index with optional settings and mappings.
Expand All @@ -115,8 +113,6 @@ async def create(self, index, body=None, params=None, headers=None):
:arg index: The name of the index
:arg body: The configuration for the index (`settings` and
`mappings`)
:arg include_type_name: Whether a type should be expected in the
body of the mappings.
:arg master_timeout: Specify timeout for connection to master
:arg timeout: Explicit operation timeout
:arg wait_for_active_shards: Set the number of active shards to
Expand Down Expand Up @@ -162,7 +158,6 @@ async def clone(self, index, target, body=None, params=None, headers=None):
"flat_settings",
"ignore_unavailable",
"include_defaults",
"include_type_name",
"local",
"master_timeout",
)
Expand All @@ -183,8 +178,6 @@ async def get(self, index, params=None, headers=None):
false)
:arg include_defaults: Whether to return all default setting for
each of the indices.
:arg include_type_name: Whether to add the type name to the
response (default: false)
:arg local: Return local information, do not retrieve the state
from master node (default: false)
:arg master_timeout: Specify timeout for connection to master
Expand Down Expand Up @@ -336,7 +329,6 @@ async def exists(self, index, params=None, headers=None):
"allow_no_indices",
"expand_wildcards",
"ignore_unavailable",
"include_type_name",
"master_timeout",
"timeout",
"write_index_only",
Expand All @@ -358,8 +350,6 @@ async def put_mapping(self, body, index=None, params=None, headers=None):
closed, hidden, none, all Default: open
:arg ignore_unavailable: Whether specified concrete indices
should be ignored when unavailable (missing or closed)
:arg include_type_name: Whether a type should be expected in the
body of the mappings.
:arg master_timeout: Specify timeout for connection to master
:arg timeout: Explicit operation timeout
:arg write_index_only: When true, applies mappings only to the
Expand All @@ -380,7 +370,6 @@ async def put_mapping(self, body, index=None, params=None, headers=None):
"allow_no_indices",
"expand_wildcards",
"ignore_unavailable",
"include_type_name",
"local",
"master_timeout",
)
Expand All @@ -398,8 +387,6 @@ async def get_mapping(self, index=None, params=None, headers=None):
closed, hidden, none, all Default: open
:arg ignore_unavailable: Whether specified concrete indices
should be ignored when unavailable (missing or closed)
:arg include_type_name: Whether to add the type name to the
response (default: false)
:arg local: Return local information, do not retrieve the state
from master node (default: false)
:arg master_timeout: Specify timeout for connection to master
Expand All @@ -416,7 +403,6 @@ async def get_mapping(self, index=None, params=None, headers=None):
"expand_wildcards",
"ignore_unavailable",
"include_defaults",
"include_type_name",
"local",
)
async def get_field_mapping(self, fields, index=None, params=None, headers=None):
Expand All @@ -436,8 +422,6 @@ async def get_field_mapping(self, fields, index=None, params=None, headers=None)
should be ignored when unavailable (missing or closed)
:arg include_defaults: Whether the default mapping values should
be returned as well
:arg include_type_name: Whether a type should be returned in the
body of the mappings.
:arg local: Return local information, do not retrieve the state
from master node (default: false)
"""
Expand Down Expand Up @@ -567,7 +551,7 @@ async def delete_alias(self, index, name, params=None, headers=None):
"DELETE", _make_path(index, "_alias", name), params=params, headers=headers
)

@query_params("create", "include_type_name", "master_timeout", "order")
@query_params("create", "master_timeout", "order")
async def put_template(self, name, body, params=None, headers=None):
"""
Creates or updates an index template.
Expand All @@ -577,8 +561,6 @@ async def put_template(self, name, body, params=None, headers=None):
:arg body: The template definition
:arg create: Whether the index template should only be added if
new or can also replace an existing one
:arg include_type_name: Whether a type should be returned in the
body of the mappings.
:arg master_timeout: Specify timeout for connection to master
:arg order: The order for this template when merging multiple
matching ones (higher numbers are merged later, overriding the lower
Expand Down Expand Up @@ -617,7 +599,7 @@ async def exists_template(self, name, params=None, headers=None):
"HEAD", _make_path("_template", name), params=params, headers=headers
)

@query_params("flat_settings", "include_type_name", "local", "master_timeout")
@query_params("flat_settings", "local", "master_timeout")
async def get_template(self, name=None, params=None, headers=None):
"""
Returns an index template.
Expand All @@ -626,8 +608,6 @@ async def get_template(self, name=None, params=None, headers=None):
:arg name: The comma separated names of the index templates
:arg flat_settings: Return settings in flat format (default:
false)
:arg include_type_name: Whether a type should be returned in the
body of the mappings.
:arg local: Return local information, do not retrieve the state
from master node (default: false)
:arg master_timeout: Explicit operation timeout for connection
Expand Down Expand Up @@ -1094,7 +1074,6 @@ async def split(self, index, target, body=None, params=None, headers=None):

@query_params(
"dry_run",
"include_type_name",
"master_timeout",
"timeout",
"wait_for_active_shards",
Expand All @@ -1114,8 +1093,6 @@ async def rollover(
:arg dry_run: If set to true the rollover action will only be
validated but not actually performed even if a condition matches. The
default is false
:arg include_type_name: Whether a type should be included in the
body of the mappings.
:arg master_timeout: Specify timeout for connection to master
:arg timeout: Explicit operation timeout
:arg wait_for_active_shards: Set the number of active shards to
Expand Down
8 changes: 0 additions & 8 deletions opensearchpy/_async/client/indices.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ class IndicesClient(NamespacedClient):
index: Any,
*,
body: Optional[Any] = ...,
include_type_name: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
timeout: Optional[Any] = ...,
wait_for_active_shards: Optional[Any] = ...,
Expand Down Expand Up @@ -142,7 +141,6 @@ class IndicesClient(NamespacedClient):
flat_settings: Optional[Any] = ...,
ignore_unavailable: Optional[Any] = ...,
include_defaults: Optional[Any] = ...,
include_type_name: Optional[Any] = ...,
local: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
pretty: Optional[bool] = ...,
Expand Down Expand Up @@ -257,7 +255,6 @@ class IndicesClient(NamespacedClient):
allow_no_indices: Optional[Any] = ...,
expand_wildcards: Optional[Any] = ...,
ignore_unavailable: Optional[Any] = ...,
include_type_name: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
timeout: Optional[Any] = ...,
write_index_only: Optional[Any] = ...,
Expand All @@ -281,7 +278,6 @@ class IndicesClient(NamespacedClient):
allow_no_indices: Optional[Any] = ...,
expand_wildcards: Optional[Any] = ...,
ignore_unavailable: Optional[Any] = ...,
include_type_name: Optional[Any] = ...,
local: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
pretty: Optional[bool] = ...,
Expand All @@ -306,7 +302,6 @@ class IndicesClient(NamespacedClient):
expand_wildcards: Optional[Any] = ...,
ignore_unavailable: Optional[Any] = ...,
include_defaults: Optional[Any] = ...,
include_type_name: Optional[Any] = ...,
local: Optional[Any] = ...,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
Expand Down Expand Up @@ -431,7 +426,6 @@ class IndicesClient(NamespacedClient):
*,
body: Any,
create: Optional[Any] = ...,
include_type_name: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
order: Optional[Any] = ...,
pretty: Optional[bool] = ...,
Expand Down Expand Up @@ -472,7 +466,6 @@ class IndicesClient(NamespacedClient):
*,
name: Optional[Any] = ...,
flat_settings: Optional[Any] = ...,
include_type_name: Optional[Any] = ...,
local: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
pretty: Optional[bool] = ...,
Expand Down Expand Up @@ -838,7 +831,6 @@ class IndicesClient(NamespacedClient):
body: Optional[Any] = ...,
new_index: Optional[Any] = ...,
dry_run: Optional[Any] = ...,
include_type_name: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
timeout: Optional[Any] = ...,
wait_for_active_shards: Optional[Any] = ...,
Expand Down
29 changes: 3 additions & 26 deletions opensearchpy/client/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ def flush(self, index=None, params=None, headers=None):
"POST", _make_path(index, "_flush"), params=params, headers=headers
)

@query_params(
"include_type_name", "master_timeout", "timeout", "wait_for_active_shards"
)
@query_params("master_timeout", "timeout", "wait_for_active_shards")
def create(self, index, body=None, params=None, headers=None):
"""
Creates an index with optional settings and mappings.
Expand All @@ -115,8 +113,6 @@ def create(self, index, body=None, params=None, headers=None):
:arg index: The name of the index
:arg body: The configuration for the index (`settings` and
`mappings`)
:arg include_type_name: Whether a type should be expected in the
body of the mappings.
:arg master_timeout: Specify timeout for connection to master
:arg timeout: Explicit operation timeout
:arg wait_for_active_shards: Set the number of active shards to
Expand Down Expand Up @@ -162,7 +158,6 @@ def clone(self, index, target, body=None, params=None, headers=None):
"flat_settings",
"ignore_unavailable",
"include_defaults",
"include_type_name",
"local",
"master_timeout",
)
Expand All @@ -183,8 +178,6 @@ def get(self, index, params=None, headers=None):
false)
:arg include_defaults: Whether to return all default setting for
each of the indices.
:arg include_type_name: Whether to add the type name to the
response (default: false)
:arg local: Return local information, do not retrieve the state
from master node (default: false)
:arg master_timeout: Specify timeout for connection to master
Expand Down Expand Up @@ -336,7 +329,6 @@ def exists(self, index, params=None, headers=None):
"allow_no_indices",
"expand_wildcards",
"ignore_unavailable",
"include_type_name",
"master_timeout",
"timeout",
"write_index_only",
Expand All @@ -358,8 +350,6 @@ def put_mapping(self, body, index=None, params=None, headers=None):
closed, hidden, none, all Default: open
:arg ignore_unavailable: Whether specified concrete indices
should be ignored when unavailable (missing or closed)
:arg include_type_name: Whether a type should be expected in the
body of the mappings.
:arg master_timeout: Specify timeout for connection to master
:arg timeout: Explicit operation timeout
:arg write_index_only: When true, applies mappings only to the
Expand All @@ -383,7 +373,6 @@ def put_mapping(self, body, index=None, params=None, headers=None):
"allow_no_indices",
"expand_wildcards",
"ignore_unavailable",
"include_type_name",
"local",
"master_timeout",
)
Expand All @@ -401,8 +390,6 @@ def get_mapping(self, index=None, params=None, headers=None):
closed, hidden, none, all Default: open
:arg ignore_unavailable: Whether specified concrete indices
should be ignored when unavailable (missing or closed)
:arg include_type_name: Whether to add the type name to the
response (default: false)
:arg local: Return local information, do not retrieve the state
from master node (default: false)
:arg master_timeout: Specify timeout for connection to master
Expand All @@ -419,7 +406,6 @@ def get_mapping(self, index=None, params=None, headers=None):
"expand_wildcards",
"ignore_unavailable",
"include_defaults",
"include_type_name",
"local",
)
def get_field_mapping(self, fields, index=None, params=None, headers=None):
Expand All @@ -439,8 +425,6 @@ def get_field_mapping(self, fields, index=None, params=None, headers=None):
should be ignored when unavailable (missing or closed)
:arg include_defaults: Whether the default mapping values should
be returned as well
:arg include_type_name: Whether a type should be returned in the
body of the mappings.
:arg local: Return local information, do not retrieve the state
from master node (default: false)
"""
Expand Down Expand Up @@ -570,7 +554,7 @@ def delete_alias(self, index, name, params=None, headers=None):
"DELETE", _make_path(index, "_alias", name), params=params, headers=headers
)

@query_params("create", "include_type_name", "master_timeout", "order")
@query_params("create", "master_timeout", "order")
def put_template(self, name, body, params=None, headers=None):
"""
Creates or updates an index template.
Expand All @@ -580,8 +564,6 @@ def put_template(self, name, body, params=None, headers=None):
:arg body: The template definition
:arg create: Whether the index template should only be added if
new or can also replace an existing one
:arg include_type_name: Whether a type should be returned in the
body of the mappings.
:arg master_timeout: Specify timeout for connection to master
:arg order: The order for this template when merging multiple
matching ones (higher numbers are merged later, overriding the lower
Expand Down Expand Up @@ -620,7 +602,7 @@ def exists_template(self, name, params=None, headers=None):
"HEAD", _make_path("_template", name), params=params, headers=headers
)

@query_params("flat_settings", "include_type_name", "local", "master_timeout")
@query_params("flat_settings", "local", "master_timeout")
def get_template(self, name=None, params=None, headers=None):
"""
Returns an index template.
Expand All @@ -629,8 +611,6 @@ def get_template(self, name=None, params=None, headers=None):
:arg name: The comma separated names of the index templates
:arg flat_settings: Return settings in flat format (default:
false)
:arg include_type_name: Whether a type should be returned in the
body of the mappings.
:arg local: Return local information, do not retrieve the state
from master node (default: false)
:arg master_timeout: Explicit operation timeout for connection
Expand Down Expand Up @@ -1124,7 +1104,6 @@ def split(self, index, target, body=None, params=None, headers=None):

@query_params(
"dry_run",
"include_type_name",
"master_timeout",
"timeout",
"wait_for_active_shards",
Expand All @@ -1142,8 +1121,6 @@ def rollover(self, alias, body=None, new_index=None, params=None, headers=None):
:arg dry_run: If set to true the rollover action will only be
validated but not actually performed even if a condition matches. The
default is false
:arg include_type_name: Whether a type should be included in the
body of the mappings.
:arg master_timeout: Specify timeout for connection to master
:arg timeout: Explicit operation timeout
:arg wait_for_active_shards: Set the number of active shards to
Expand Down
Loading