Skip to content

Commit c806e53

Browse files
committed
Update elasticsearch client libraries to 8.x
This removes elasticsearch_dsl as it's now integrated into elasticsearch python library, and adds elastic-transport which that is now a dependency. ELASTIC_CLIENT_APIVERSIONING=1 is no longer needed as of this change, everything is on 8.x.
1 parent f264e88 commit c806e53

File tree

9 files changed

+17
-19
lines changed

9 files changed

+17
-19
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ updates:
5858
- ">= 6"
5959
- dependency-name: elasticsearch
6060
versions:
61-
- ">= 8"
62-
- dependency-name: elasticsearch-dsl
61+
- ">= 9"
62+
- dependency-name: elasticsearch-transport
6363
versions:
64-
- ">= 8"
64+
- ">= 9"
6565
- dependency-name: kombu
6666
versions:
6767
- ">= 6"

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ ENV NPM_DEPS_DIR=${HOME}/node_modules
1818
ENV VITE_MANIFEST_FILE_NAME=manifest.json
1919
ENV STATIC_URL_PREFIX=/static-server/
2020
ENV MEDIA_URL_PREFIX=/user-media/
21-
ENV ELASTIC_CLIENT_APIVERSIONING=1
2221
RUN <<EOF
2322
groupadd -g ${OLYMPIA_UID} olympia
2423
useradd -u ${OLYMPIA_UID} -g ${OLYMPIA_UID} -s /sbin/nologin -d ${HOME} olympia

requirements/prod.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ pyparsing==3.3.1 \
167167
setuptools==80.9.0 \
168168
--hash=sha256:062d34222ad13e0cc312a4c02d73f059e86a4acbfbdea8f8f76b28c99f306922 \
169169
--hash=sha256:f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c
170-
# six is required by Sphinx, bleach, cryptography, django-environ, django-extensions, django-tables2, docker-compose, docker-py, docker-pycreds, dockerpty, elasticsearch-dsl, html5lib, mock, nobot, packaging, pathlib2, prompt_toolkit, sphinxcontrib-httpdomain, websocket-client
170+
# six is required by Sphinx, bleach, cryptography, django-environ, django-extensions, django-tables2, docker-compose, docker-py, docker-pycreds, dockerpty, html5lib, mock, nobot, packaging, pathlib2, prompt_toolkit, sphinxcontrib-httpdomain, websocket-client
171171
six==1.17.0 \
172172
--hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 \
173173
--hash=sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81
@@ -686,13 +686,12 @@ dockerflow==2024.4.2 \
686686
drf-nested-routers==0.95.0 \
687687
--hash=sha256:815978f802e578fd7035c74040c104909cbe97615de89a275d77e928f4029891 \
688688
--hash=sha256:dd489c33d667aaa81383ffaa8c74781d2b353d8f0795716ae37fc59ee297b7c4
689-
# elasticsearch is required by elasticsearch-dsl
690-
elasticsearch==7.17.13 \
691-
--hash=sha256:ba1b87322045fc37831009c7c49ef0e2777165a2ad3390df4d9e2b7a09d90c86 \
692-
--hash=sha256:dac73df9a9070b9c96be45d99f4316badc525f8b17f418e9c86da2bb5855c892
693-
elasticsearch-dsl==7.4.1 \
694-
--hash=sha256:07ee9c87dc28cc3cae2daa19401e1e18a172174ad9e5ca67938f752e3902a1d5 \
695-
--hash=sha256:97f79239a252be7c4cce554c29e64695d7ef6a4828372316a5e5ff815e7a7498
689+
elasticsearch==8.19.3 \
690+
--hash=sha256:e84dd618a220cac25b962790085045dd27ac72e01c0a5d81bd29a2d47a71f03f \
691+
--hash=sha256:fe1db2555811192e8a1be78b01234d0a49d32b185ea7eeeb6f059331dee32838
692+
elastic-transport==8.17.1 \
693+
--hash=sha256:192718f498f1d10c5e9aa8b9cf32aed405e469a7f0e9d6a8923431dbb2c59fb8 \
694+
--hash=sha256:5edef32ac864dca8e2f0a613ef63491ee8d6b8cfb52881fa7313ba9290cac6d2
696695
email-reply-parser==0.5.12 \
697696
--hash=sha256:d051cfa8f54046f7399553aae57f17f62bf1652f83e3e9970fd109c0f24a880c \
698697
--hash=sha256:3499c02284679e020acf8aa30ef9e43c62f9ab5ccee0a35bfac85a0c1fa685fd \
@@ -844,7 +843,7 @@ pymemcache==4.0.0 \
844843
prompt_toolkit==3.0.52 \
845844
--hash=sha256:28cde192929c8e7321de85de1ddbe736f1375148b02f2e17edd840042b1be855 \
846845
--hash=sha256:9aac639a3bbd33284347de5ad8d68ecc044b91a762dc39b7c21095fcd6a19955
847-
# python-dateutil is required by elasticsearch-dsl
846+
# python-dateutil is required by elasticsearch
848847
python-dateutil==2.9.0.post0 \
849848
--hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \
850849
--hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427

src/olympia/addons/tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from django.db.models import Q, Value
99
from django.db.models.functions import Collate
1010

11-
from elasticsearch_dsl import Search
11+
from elasticsearch.dsl import Search
1212

1313
import olympia.core
1414
from olympia import activity, amo

src/olympia/addons/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import waffle
1212
from drf_spectacular.utils import extend_schema, extend_schema_view
13-
from elasticsearch_dsl import Q, Search, query
13+
from elasticsearch.dsl import Q, Search, query
1414
from rest_framework import exceptions, serializers, status
1515
from rest_framework.decorators import action
1616
from rest_framework.generics import ListAPIView

src/olympia/api/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from django.conf import settings
66
from django.core.exceptions import ImproperlyConfigured
77

8-
from elasticsearch_dsl.response.hit import Hit
8+
from elasticsearch.dsl.response.hit import Hit
99
from rest_framework import serializers
1010

1111
from olympia import amo

src/olympia/ratings/tests/test_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from django.core import mail
44
from django.core.exceptions import ValidationError
55

6-
from elasticsearch_dsl import Q, Search
6+
from elasticsearch.dsl import Q, Search
77

88
from olympia import amo, core
99
from olympia.activity.models import ActivityLog

src/olympia/search/filters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from django.utils.translation import gettext
88

99
import colorgram
10-
from elasticsearch_dsl import Q, query
10+
from elasticsearch.dsl import Q, query
1111
from rest_framework import serializers
1212
from rest_framework.filters import BaseFilterBackend
1313
from waffle import switch_is_active

src/olympia/search/tests/test_filters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from django.utils.http import urlsafe_base64_encode
99

1010
import time_machine
11-
from elasticsearch_dsl import Search
11+
from elasticsearch.dsl import Search
1212
from rest_framework import serializers
1313

1414
from olympia import amo

0 commit comments

Comments
 (0)