elasticsearch-py icon indicating copy to clipboard operation
elasticsearch-py copied to clipboard

Missing some parameters in open_point_in_time

Open johtani opened this issue 3 years ago • 0 comments

Elasticsearch version : 8.x

elasticsearch-py version (elasticsearch.__versionstr__): 8.4.3

Description of the problem including expected versus actual behavior: Steps to reproduce:

We can still use routing parameter with open_point_in_time in Elasticsearch 8.x, however I got the TypeError from elasticsearch-py. I think it's a bug. Traceback is here:

Traceback (most recent call last):
  File "es-py-sample\main.py", line 20, in <module>
    print_hi('PyCharm')
  File "es-py-sample\main.py", line 11, in print_hi
    res = es.open_point_in_time(index="wikidata",keep_alive="1m",routing="1")
  File "es-py-sample\venv\lib\site-packages\elasticsearch\_sync\client\utils.py", line 414, in wrapped
    return api(*args, **kwargs)
TypeError: open_point_in_time() got an unexpected keyword argument 'routing'

Until 7.17 elasticsearch-py, routing parameter and some other parameters support in open_point_in_time. https://github.com/elastic/elasticsearch-py/blob/7.17/elasticsearch/client/init.py#L2301-L2325

After 8.0, missing routing and some parameters. https://github.com/elastic/elasticsearch-py/blob/8.0/elasticsearch/_sync/client/init.py#L2768

Elasticsearch 8.4 still support routing, expand_wildcards, preferences params in open_point_in_time API. See rest-api-spec in Elasticsearch repo. Also these params are on Point in time API Reference and source in Es.

Unfortunately, only 2 params are in elasticsearch-specification repo, I think that is the root cause...

What do you think?

johtani avatar Oct 12 '22 10:10 johtani