in elastic/shared/query_handlers/date_histogram.py [0:0]
def read_ranges(self):
if "extended_bounds" in self.request_body:
self.extended_bounds = self.request_body["extended_bounds"]
self.request_body["time_zone"] = "UTC"
if "min" in self.extended_bounds and "max" in self.extended_bounds:
try:
self.max_bound = datetime.datetime.utcfromtimestamp(int(self.extended_bounds["max"]) / 1000)
self.min_bound = datetime.datetime.utcfromtimestamp(int(self.extended_bounds["min"]) / 1000)
except ValueError:
raise exceptions.TrackConfigError(
f"Date Histogram aggregation requires epoch milliseconds for its "
f'"min" and "max" extended bounds - [{self.request_body}]'
)
if self.min_bound >= self.max_bound:
raise exceptions.TrackConfigError(
f'"min" extended bounds of Date Histogram aggregation cannot be greater than "max" ' f"- [{self.request_body}]"
)
else:
raise exceptions.TrackConfigError(
f'Date Histogram aggregation does not have both "min" and "max" ' f"for its extended bounds- [{self.request_body}]"
)