File tree Expand file tree Collapse file tree 3 files changed +11
-10
lines changed
Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 33consider this code frozen/deprecated -- will be removed once no longer needed
44"""
55
6+ from __future__ import annotations
67import collections
78from collections .abc import Iterator
89import dataclasses
1314from django .conf import settings
1415from django .utils import timezone
1516from elasticsearch6 .exceptions import NotFoundError
16- import elasticsearch6_dsl
1717from elasticsearch6_dsl import Document , connections , Date
1818from elasticsearch6_dsl .document import IndexMeta , MetaField
1919from elasticsearch6_dsl .index import Index
2020
21+ # re-export all fields, for back-compat convenience
22+ from elasticsearch6_dsl .field import * # noqa: F40
23+
2124from elasticsearch_metrics import signals
2225from elasticsearch_metrics import exceptions
2326from elasticsearch_metrics .protocols import ProtoDjelmeBackend
2730
2831logger = logging .getLogger (__name__ )
2932
30- fields = elasticsearch6_dsl .field
31-
3233
3334class ReadonlyAttrMap :
3435 def __init__ (self , inner_obj ):
Original file line number Diff line number Diff line change 22
33
44class Dummy6Metric (elastic6 .Metric ):
5- my_int = elastic6 .fields . Integer ()
5+ my_int = elastic6 .Integer ()
66
77
88class Dummy6MetricWithExplicitTemplateName (elastic6 .Metric ):
9- my_keyword = elastic6 .fields . Keyword ()
9+ my_keyword = elastic6 .Keyword ()
1010
1111 class Meta :
1212 template_name = "dummy6metric"
Original file line number Diff line number Diff line change 3434
3535
3636class PreprintView (elastic6 .Metric ):
37- provider_id = elastic6 .fields . Keyword (index = True )
38- page_id = elastic6 .fields . Keyword (index = True )
39- preprint_id = elastic6 .fields . Keyword (index = True )
40- route_name = elastic6 .fields . Text (analyzer = route_prefix_analyzer )
37+ provider_id = elastic6 .Keyword (index = True )
38+ page_id = elastic6 .Keyword (index = True )
39+ preprint_id = elastic6 .Keyword (index = True )
40+ route_name = elastic6 .Text (analyzer = route_prefix_analyzer )
4141
4242 class Index :
4343 settings = {"refresh_interval" : "-1" }
@@ -158,7 +158,7 @@ def test_template_name_defined_with_no_template_falls_back_to_default_template(
158158
159159 def test_inheritance (self ):
160160 class MyBaseMetric (elastic6 .Metric ):
161- page_id = elastic6 .fields . Keyword (index = True )
161+ page_id = elastic6 .Keyword (index = True )
162162
163163 class Index :
164164 settings = {"number_of_shards" : 2 }
You can’t perform that action at this time.
0 commit comments