ionelmc / pytest-benchmark

py.test fixture for benchmarking code
BSD 2-Clause "Simplified" License
1.24k stars 119 forks source link

add elasticsearch 8.x.x support #244

Open ckutlu opened 1 year ago

ckutlu commented 1 year ago

Elasticsearch python api deprecates the doc_type argument in the index function in v8.x.x. This is a minor fix for that.

ckutlu commented 9 months ago

I rebased this one on recent master and added stuff to authors and changelog as suggested in the contribution guide. Ran tox locally, and it seems to pass (output attached), but not sure if it ran the full suite as expected. I am not really familiar with tox. Is there anything I am missing @ionelmc ?

tox_output.log

ionelmc commented 9 months ago

How that I think of this more, considering that doc types are completely optional since es7, and I don't want to support really old stuff, I think the better way to do this is to completely remove doc_type and just require es7 as the minimum client version.

ckutlu commented 9 months ago

How that I think of this more, considering that doc types are completely optional since es7, and I don't want to support really old stuff, I think the better way to do this is to completely remove doc_type and just require es7 as the minimum client version.

Makes sense. I can constrain the elastic version to > 7 and make changes to remove supplying doc_type argument altogether in this MR then. Are you okay with it?

ionelmc commented 9 months ago

Yes, thank you.

On Mon, Dec 18, 2023, 11:23 Çağlar Kutlu @.***> wrote:

How that I think of this more, considering that doc types are completely optional since es7, and I don't want to support really old stuff, I think the better way to do this is to completely remove doc_type and just require es7 as the minimum client version.

Makes sense. I can constrain the elastic version to > 7 and make changes to remove supplying doc_type argument altogether in this MR then. Are you okay with it?

— Reply to this email directly, view it on GitHub https://github.com/ionelmc/pytest-benchmark/pull/244#issuecomment-1859876420, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA7TXPKDXVT57U2NJZS5KLYKADPPAVCNFSM6AAAAAAZ5MV3XOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJZHA3TMNBSGA . You are receiving this because you were mentioned.Message ID: @.***>

ckutlu commented 9 months ago

Sorry for the delay, just got around to doing this. Following the discussion in https://github.com/elastic/elasticsearch-py/issues/1698, I went with dropping support for below 7.15.0. Removed most of the version checks I introduced and simplified the changes. There is still a version check for ES 7 in one place. This was needed because 8.x deprecates the ignore keyword on .indices.create (https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/release-notes.html#_deprecated). I tested index creation manually using a 7.17.0 and 8.11.0 version elasticsearch python client against a locally running elastic 8.11 instance. Anything I might have missed @ionelmc ?

ckutlu commented 9 months ago
ckutlu commented 9 months ago

This should be now hopefully good to go @ionelmc

ckutlu commented 9 months ago

:facepalm: Argh, failed again. Okay, so there were two problems:

  1. I forgot to run bootstrap.py to get rid of pypy37 actions from the workflow. This should be fixed now.
  2. py312-pytest73-nodist-cover (windows) failed due to hitting the github action timeout of 30 minutes.

I am not sure how to go with the 2nd issue. 30 minutes should be more than enough given that py311-pytest73-nodist-cover (windows) runs in 8 minutes. Somehow things become 4x slower with Python 3.12. We could either increase the timeout a bit (40 min?), or maybe get rid of pytest 7.3 support since py312-pytest7.4 seem to complete within 25 min. What do you think @ionelmc ?