-
Notifications
You must be signed in to change notification settings - Fork 183
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
[BUG] v2.7.0 brings undocumented breaking change to put_index() #803
Comments
As mentioned in #777 (comment), this probably doesn't affect that many people, so perhaps the most pragmatic step is to just document this breaking change in the release notes for version 2.7.0. |
@Tenzer we follow semver, so a breaking change should be fixed. Want to help? Otherwise I'll pick it up as soon as I can. |
I guess it depends on what the optimal way to fix this would be. Would it require changes to the code generator or can it be changed directly in |
We need to write a test that reproduces the problem, then fix the generator, or the code will get overwritten. A hacky version is fine though. |
I started looking into it. I've got a test written, and then looked into the code generation. I guess we need to add some conditionals to the template for the function arguments: https://github.com/opensearch-project/opensearch-py/blob/main/utils/templates/func_params. It would need to check if it's outputting for the "put_alias" method, and then output the arguments in a different order. |
Yes, I would be perfectly fine with a very hacky solution, but I also have been thinking about something more structured like for example a folder with code patches (generated via git diff) that are applied after the code generator runs, to avoid the whole custom handling per method like here. |
I noticed there was already code in place to override certain Jinja templates, so I made use of that instead. See #804. |
What is the bug?
With versions prior to version 2.7.0 it was possible to call
client.indices.put_alias("index_name", "alias_name")
and have it create the alias.With version 2.7.0 you instead get a cryptic error message along the lines of:
How can one reproduce the bug?
client.indices.put_alias("index_name", "alias_name")
What is the expected behavior?
The alias should be created for the index like in previous opensearch-py versions.
What is your host/environment?
N/A
Do you have any screenshots?
N/A
Do you have any additional context?
This is caused by an inadvertently breaking change in #777 which changed the order of the arguments to the
put_alias()
method, meaning anybody who called the method without naming the arguments now supply their values to different arguments.The text was updated successfully, but these errors were encountered: