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 3838 TermsFacet ,
3939)
4040from .field import (
41+ AggregateMetricDouble ,
42+ Alias ,
4143 Binary ,
4244 Boolean ,
4345 Byte ,
4446 Completion ,
4547 ConstantKeyword ,
48+ CountedKeyword ,
4649 CustomField ,
4750 Date ,
51+ DateNanos ,
4852 DateRange ,
4953 DenseVector ,
5054 Double ,
5155 DoubleRange ,
5256 Field ,
57+ Flattened ,
5358 Float ,
5459 FloatRange ,
5560 GeoPoint ,
5661 GeoShape ,
5762 HalfFloat ,
63+ Histogram ,
64+ IcuCollationKeyword ,
5865 Integer ,
5966 IntegerRange ,
6067 Ip ,
6370 Keyword ,
6471 Long ,
6572 LongRange ,
73+ MatchOnlyText ,
6674 Murmur3 ,
6775 Nested ,
6876 Object ,
77+ Passthrough ,
6978 Percolator ,
7079 Point ,
7180 RangeField ,
7281 RankFeature ,
7382 RankFeatures ,
83+ RankVectors ,
7484 ScaledFloat ,
7585 SearchAsYouType ,
86+ SemanticText ,
7687 Shape ,
7788 Short ,
7889 SparseVector ,
7990 Text ,
8091 TokenCount ,
92+ UnsignedLong ,
93+ Version ,
94+ Wildcard ,
8195 construct_field ,
8296)
8397from .function import SF
108122 "A" ,
109123 "Agg" ,
110124 "AggResponse" ,
125+ "AggregateMetricDouble" ,
126+ "Alias" ,
111127 "AsyncComposableIndexTemplate" ,
112128 "AsyncDocument" ,
113129 "AsyncEmptySearch" ,
126142 "Completion" ,
127143 "ComposableIndexTemplate" ,
128144 "ConstantKeyword" ,
145+ "CountedKeyword" ,
129146 "CustomField" ,
130147 "Date" ,
131148 "DateHistogramFacet" ,
149+ "DateNanos" ,
132150 "DateRange" ,
133151 "DenseVector" ,
134152 "Document" ,
142160 "FacetedResponse" ,
143161 "FacetedSearch" ,
144162 "Field" ,
163+ "Flattened" ,
145164 "Float" ,
146165 "FloatRange" ,
147166 "GeoPoint" ,
148167 "GeoShape" ,
149168 "HalfFloat" ,
169+ "Histogram" ,
150170 "HistogramFacet" ,
171+ "IcuCollationKeyword" ,
151172 "IllegalOperation" ,
152173 "Index" ,
153174 "IndexTemplate" ,
162183 "LongRange" ,
163184 "M" ,
164185 "Mapping" ,
186+ "MatchOnlyText" ,
165187 "MetaField" ,
166188 "MultiSearch" ,
167189 "Murmur3" ,
168190 "Nested" ,
169191 "NestedFacet" ,
170192 "Object" ,
193+ "Passthrough" ,
171194 "Percolator" ,
172195 "Point" ,
173196 "Q" ,
177200 "RangeField" ,
178201 "RankFeature" ,
179202 "RankFeatures" ,
203+ "RankVectors" ,
180204 "Response" ,
181205 "SF" ,
182206 "ScaledFloat" ,
183207 "Search" ,
184208 "SearchAsYouType" ,
209+ "SemanticText" ,
185210 "Shape" ,
186211 "Short" ,
187212 "SparseVector" ,
188213 "TermsFacet" ,
189214 "Text" ,
190215 "TokenCount" ,
191216 "UnknownDslObject" ,
217+ "UnsignedLong" ,
192218 "UpdateByQuery" ,
193219 "UpdateByQueryResponse" ,
194220 "ValidationException" ,
221+ "Version" ,
222+ "Wildcard" ,
195223 "analyzer" ,
196224 "async_connections" ,
197225 "char_filter" ,
Original file line number Diff line number Diff line change 2323import pytest
2424from dateutil import tz
2525
26+ from elasticsearch import dsl
2627from elasticsearch .dsl import InnerDoc , Range , ValidationException , field
2728
2829
@@ -232,3 +233,19 @@ class Inner(InnerDoc):
232233
233234 with pytest .raises (ValidationException ):
234235 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