File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed
test_elasticsearch/test_dsl Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 38
38
TermsFacet ,
39
39
)
40
40
from .field import (
41
+ AggregateMetricDouble ,
42
+ Alias ,
41
43
Binary ,
42
44
Boolean ,
43
45
Byte ,
44
46
Completion ,
45
47
ConstantKeyword ,
48
+ CountedKeyword ,
46
49
CustomField ,
47
50
Date ,
51
+ DateNanos ,
48
52
DateRange ,
49
53
DenseVector ,
50
54
Double ,
51
55
DoubleRange ,
52
56
Field ,
57
+ Flattened ,
53
58
Float ,
54
59
FloatRange ,
55
60
GeoPoint ,
56
61
GeoShape ,
57
62
HalfFloat ,
63
+ Histogram ,
64
+ IcuCollationKeyword ,
58
65
Integer ,
59
66
IntegerRange ,
60
67
Ip ,
63
70
Keyword ,
64
71
Long ,
65
72
LongRange ,
73
+ MatchOnlyText ,
66
74
Murmur3 ,
67
75
Nested ,
68
76
Object ,
77
+ Passthrough ,
69
78
Percolator ,
70
79
Point ,
71
80
RangeField ,
72
81
RankFeature ,
73
82
RankFeatures ,
83
+ RankVectors ,
74
84
ScaledFloat ,
75
85
SearchAsYouType ,
86
+ SemanticText ,
76
87
Shape ,
77
88
Short ,
78
89
SparseVector ,
79
90
Text ,
80
91
TokenCount ,
92
+ UnsignedLong ,
93
+ Version ,
94
+ Wildcard ,
81
95
construct_field ,
82
96
)
83
97
from .function import SF
108
122
"A" ,
109
123
"Agg" ,
110
124
"AggResponse" ,
125
+ "AggregateMetricDouble" ,
126
+ "Alias" ,
111
127
"AsyncComposableIndexTemplate" ,
112
128
"AsyncDocument" ,
113
129
"AsyncEmptySearch" ,
126
142
"Completion" ,
127
143
"ComposableIndexTemplate" ,
128
144
"ConstantKeyword" ,
145
+ "CountedKeyword" ,
129
146
"CustomField" ,
130
147
"Date" ,
131
148
"DateHistogramFacet" ,
149
+ "DateNanos" ,
132
150
"DateRange" ,
133
151
"DenseVector" ,
134
152
"Document" ,
142
160
"FacetedResponse" ,
143
161
"FacetedSearch" ,
144
162
"Field" ,
163
+ "Flattened" ,
145
164
"Float" ,
146
165
"FloatRange" ,
147
166
"GeoPoint" ,
148
167
"GeoShape" ,
149
168
"HalfFloat" ,
169
+ "Histogram" ,
150
170
"HistogramFacet" ,
171
+ "IcuCollationKeyword" ,
151
172
"IllegalOperation" ,
152
173
"Index" ,
153
174
"IndexTemplate" ,
162
183
"LongRange" ,
163
184
"M" ,
164
185
"Mapping" ,
186
+ "MatchOnlyText" ,
165
187
"MetaField" ,
166
188
"MultiSearch" ,
167
189
"Murmur3" ,
168
190
"Nested" ,
169
191
"NestedFacet" ,
170
192
"Object" ,
193
+ "Passthrough" ,
171
194
"Percolator" ,
172
195
"Point" ,
173
196
"Q" ,
177
200
"RangeField" ,
178
201
"RankFeature" ,
179
202
"RankFeatures" ,
203
+ "RankVectors" ,
180
204
"Response" ,
181
205
"SF" ,
182
206
"ScaledFloat" ,
183
207
"Search" ,
184
208
"SearchAsYouType" ,
209
+ "SemanticText" ,
185
210
"Shape" ,
186
211
"Short" ,
187
212
"SparseVector" ,
188
213
"TermsFacet" ,
189
214
"Text" ,
190
215
"TokenCount" ,
191
216
"UnknownDslObject" ,
217
+ "UnsignedLong" ,
192
218
"UpdateByQuery" ,
193
219
"UpdateByQueryResponse" ,
194
220
"ValidationException" ,
221
+ "Version" ,
222
+ "Wildcard" ,
195
223
"analyzer" ,
196
224
"async_connections" ,
197
225
"char_filter" ,
Original file line number Diff line number Diff line change 23
23
import pytest
24
24
from dateutil import tz
25
25
26
+ from elasticsearch import dsl
26
27
from elasticsearch .dsl import InnerDoc , Range , ValidationException , field
27
28
28
29
@@ -232,3 +233,19 @@ class Inner(InnerDoc):
232
233
233
234
with pytest .raises (ValidationException ):
234
235
field .Object (doc_class = Inner , dynamic = False )
236
+
237
+
238
+ def test_all_fields_exported () -> None :
239
+ """Make sure that all the generated field classes are exported at the top-level"""
240
+ fields = [
241
+ f
242
+ for f in dir (field )
243
+ if isinstance (getattr (field , f ), type )
244
+ and issubclass (getattr (field , f ), field .Field )
245
+ ]
246
+ all = dir (dsl )
247
+ not_found = []
248
+ for f in fields :
249
+ if f not in all :
250
+ not_found .append (f )
251
+ assert not_found == []
You can’t perform that action at this time.
0 commit comments