Skip to content

Commit 276280e

Browse files
committed
Patch the second import of AggsProxy
1 parent 78c665c commit 276280e

File tree

1 file changed

+9
-1
lines changed
  • src/django_elasticsearch_dsl_drf/filter_backends/suggester

1 file changed

+9
-1
lines changed

src/django_elasticsearch_dsl_drf/filter_backends/suggester/functional.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,15 @@
6767
>>>
6868
>>> model = Publisher # The model associate with this Document
6969
"""
70-
from elasticsearch_dsl.search import AggsProxy
70+
try: # code for 8.13 (requires 8.13.1)
71+
# This should not be imported in external projects, as it is a internal tool.
72+
# See https://github.com/barseghyanartur/django-elasticsearch-dsl-drf/pull/316/files#r1596499499
73+
from elasticsearch_dsl.search_base import AggsProxy
74+
except ImportError:
75+
# backward-compatible (older than 8.13)
76+
from elasticsearch_dsl.search import AggsProxy
77+
78+
from elasticsearch_dsl.search_base import AggsProxy
7179

7280
from django_elasticsearch_dsl_drf.constants import (
7381
FUNCTIONAL_SUGGESTER_TERM_MATCH,

0 commit comments

Comments
 (0)