Skip to content

Commit 81ff50c

Browse files
use internal aggregation range class for date aggregation ranges (#2897) (#2898)
(cherry picked from commit 0d23e6b) Co-authored-by: Miguel Grinberg <[email protected]>
1 parent 13f891e commit 81ff50c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: utils/dsl-generator.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,12 @@ def get_python_type(self, schema_type, for_response=False):
345345
]["name"].endswith("Analyzer"):
346346
# not expanding analyzers at this time, maybe in the future
347347
return "str, Dict[str, Any]", None
348-
elif (
349-
schema_type["name"]["namespace"] == "_types.aggregations"
350-
and schema_type["name"]["name"].endswith("AggregationRange")
351-
and schema_type["name"]["name"] != "IpRangeAggregationRange"
352-
):
353-
return '"wrappers.AggregationRange"', None
348+
elif schema_type["name"]["namespace"] == "_types.aggregations":
349+
if (
350+
schema_type["name"]["name"].endswith("AggregationRange")
351+
or schema_type["name"]["name"] == "DateRangeExpression"
352+
) and schema_type["name"]["name"] != "IpRangeAggregationRange":
353+
return '"wrappers.AggregationRange"', None
354354

355355
# to handle other interfaces we generate a type of the same name
356356
# and add the interface to the interfaces.py module

0 commit comments

Comments
 (0)