Skip to content

Switch from elasticsearch-dsl-py dependency to elasticsearch-py #492

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

violuke
Copy link

@violuke violuke commented Apr 22, 2025

Closes #491

@safwanrahman
Copy link
Collaborator

safwanrahman commented May 6, 2025

@violuke The test suite is failing, can you check the issues?

@violuke
Copy link
Author

violuke commented May 6, 2025

I've pushed some adjustments in an attempt to fix this, but I cannot get the tests to run locally or via my own fork's GH actions. I might need some help getting these to run. I don't think it's a code problem, but more of a test config/matrix issue.

@madrigall
Copy link

Hello @safwanrahman,

Could you please take a look at this PR when you have a moment? These changes are important for us too, to add support for Elasticsearch 9.

Thanks in advance!

@safwanrahman
Copy link
Collaborator

Ok. Going to take a look later today

@madrigall
Copy link

@safwanrahman
Thanks a lot!

@safwanrahman safwanrahman requested a review from Copilot May 20, 2025 20:52
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the elasticsearch-dsl-py dependency and imports with the new elasticsearch-py package, bumps the library version to 9.x, and updates testing/CI configurations to cover Elasticsearch 9 and Django 5.

  • Switched all imports and install requirements from elasticsearch-dsl to elasticsearch
  • Bumped package version from 8.x to 9.0 and updated tox/CI matrices for Python 3.12/3.13 and Django 5.x
  • Updated documentation and examples to reference the new package

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tox.ini Added es9 env, Django 5.x and Python 3.12/3.13
setup.py / setup.cfg Bumped library version to 9.0 and install_requires
requirements_dev.txt Replaced elasticsearch-dsl with elasticsearch
README.rst Updated narrative to elasticsearch-py
docs/source/es_index.rst Updated import path to elasticsearch.dsl.Index
.github/workflows/ci.yml Extended matrix for ES 9, Python 3.12/3.13, Django 5
All code under django_elasticsearch_dsl and tests Swapped imports from elasticsearch_dsl to elasticsearch.dsl
Comments suppressed due to low confidence (1)

.github/workflows/ci.yml:28

  • Add exclude entries for combinations where es-py-version (6.4 or 7.4) is tested against Elasticsearch server 9.0.0, which would otherwise run unsupported client/server pairs.
-          - es-py-version: "6.4"

@@ -45,6 +47,9 @@ The library is compatible with all Elasticsearch versions since 5.x

.. code-block:: python

# Elasticsearch 9.x
elasticsearch-dsl>=9.0.0,<10.0.0
Copy link
Preview

Copilot AI May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the code snippet to reference elasticsearch>=9.0.0,<10.0.0 instead of elasticsearch-dsl to match the new dependency.

Suggested change
elasticsearch-dsl>=9.0.0,<10.0.0
elasticsearch>=9.0.0,<10.0.0

Copilot uses AI. Check for mistakes.

@@ -1,5 +1,5 @@
[bumpversion]
current_version = 7.1.1
current_version = 9.0
Copy link
Preview

Copilot AI May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider using a full semantic version (e.g., 9.0.0) for current_version to align with versioning conventions and bumpversion expectations.

Suggested change
current_version = 9.0
current_version = 9.0.0

Copilot uses AI. Check for mistakes.

@@ -8,7 +8,7 @@
except ImportError:
from distutils.core import setup

version = '8.0'
version = '9.0'
Copy link
Preview

Copilot AI May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] To match the dependency versions and semantic versioning, consider updating this to version = '9.0.0'.

Suggested change
version = '9.0'
version = '9.0.0'

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch from elasticsearch-dsl-py dependency to elasticsearch-py (it has been merged into a single package)
3 participants