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

Unexpected ilm.put_lifecycle behavior #2526

Open
untergeek opened this issue Apr 11, 2024 · 0 comments
Open

Unexpected ilm.put_lifecycle behavior #2526

untergeek opened this issue Apr 11, 2024 · 0 comments

Comments

@untergeek
Copy link
Member

Elasticsearch version (8.13.0):

elasticsearch-py version (elasticsearch8==8.13.0):

Description of the problem including expected versus actual behavior:

From what I looked through in the API spec pages, this didn't seem like an issue there per se, but it still might be. In attempting to follow the layout in IlmClient.put_lifecycle, it shows that name is positional, and policy is a keyword arg. But when calling like that, I get:

File "/path/to/lib/python3.12/site-packages/elasticsearch8/_sync/client/utils.py", line 341, in wrapped
    raise TypeError(
TypeError: Positional arguments can't be used with Elasticsearch API methods. Instead only use keyword arguments.

If I call with name='stringval', policy={'phases':{}}, it works.

Steps to reproduce:

ilm_name = 'arbitrary'
phases = {'phases': {}}
client.ilm.put_lifecycle(ilm_name, policy=phases)

Workaround:

ilm_name = 'arbitrary'
phases = {'phases': {}}
client.ilm.put_lifecycle(name=ilm_name, policy=phases)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants