Unexpected ilm.put_lifecycle behavior
untergeek opened this issue · 0 comments
untergeek commented
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)