-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add override for code generator to change
indices.put_alias
argumen…
…t order (#804) * Add currently-failing test to validate the original argument order Signed-off-by: Jeppe Fihl-Pearson <jeppe@memrise.com> * Add workaround for breaking API change inadvertently added in v2.7.0 Signed-off-by: Jeppe Fihl-Pearson <jeppe@memrise.com> * Generate new version of the client code with the correct argument order Signed-off-by: Jeppe Fihl-Pearson <jeppe@memrise.com> --------- Signed-off-by: Jeppe Fihl-Pearson <jeppe@memrise.com>
- Loading branch information
Showing
7 changed files
with
147 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{% extends "base" %} | ||
{% block func_params %}{% include "overrides/indices/put_alias-func_params" %}{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{# Work around for https://github.com/opensearch-project/opensearch-py/issues/803 #} | ||
|
||
{% set first_params = ["index", "name"] %} | ||
|
||
{% for p, info in api.all_parts.items() %} | ||
{% if info.required %}{{ p }}: {{ info.type }}, {% endif %} | ||
{% endfor %} | ||
|
||
{% for p, info in api.all_parts.items() if p in first_params %} | ||
{% if not info.type == 'Any' %}{{ p }}: Optional[{{ info.type }}]=None, {% endif %} | ||
{% if info.type == 'Any' %}{{ p }}: {{ info.type }}=None, {% endif %} | ||
{% endfor %} | ||
|
||
{% if api.body %} | ||
body{% if not api.body.required %}: Any=None{% else %}: Any{% endif %}, | ||
{% endif %} | ||
|
||
{% for p, info in api.all_parts.items() if p not in first_params %} | ||
{% if not info.required and not info.type == 'Any' %}{{ p }}: Optional[{{ info.type }}]=None, {% endif %} | ||
{% if not info.required and info.type == 'Any' %}{{ p }}: {{ info.type }}=None, {% endif %} | ||
{% endfor %} | ||
|
||
params: Any=None, | ||
headers: Any=None, |