New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove mapping.date.round_ceil
setting for date math parsing
#8889
Conversation
Note that there are a bunch of integration tests scattered around that are testing date math. Given the much better unit tests here now, I would like to remove the majority of them, leaving only basic checks of date math integration, but leaving extensive testing for the format to the unit tests. However, I do not yet have that change here, but wanted to first get a feel for opinions on their removal. |
The change looks good to me. Big +1 on removing all the scattered date-math tests and focusing on having good unit tests in only one or two test suites. |
@jpountz I've removed some tests. Let me know if you think I went to far...or not far enough. |
@rjernst LGTM |
d9e976e
to
fbba764
Compare
The setting `mapping.date.round_ceil` (and the undocumented setting `index.mapping.date.parse_upper_inclusive`) affect how date ranges using `lte` are parsed. In elastic#8556 the semantics of date rounding were solidified, eliminating the need to have different parsing functions whether the date is inclusive or exclusive. This change removes these legacy settings and improves the tests for the date math parser (now at 100% coverage!). It also removes the unnecessary function `DateMathParser.parseTimeZone` for which the existing `DateTimeZone.forID` handles all use cases. Any user previously using these settings can refer to the changed semantics and change their query accordingly. This is a breaking change because even dates without datemath previously used the different parsing functions depending on context. closes elastic#8598 closes elastic#8889
mapping.date.round_ceil
setting for date math parsingmapping.date.round_ceil
setting for date math parsing
Elasticsearch 1.x used to implicitly round up upper bounds of queries when they were inclusive so that eg. `[2016-09-18 TO 2016-09-20]` would actually run `[2016-09-18T00:00:00.000Z TO 2016-09-20T23:59:59.999Z]` and include dates like `2016-09-20T15:32:44`. This behaviour was lost in the cleanups of elastic#8889. Closes elastic#20579
Elasticsearch 1.x used to implicitly round up upper bounds of queries when they were inclusive so that eg. `[2016-09-18 TO 2016-09-20]` would actually run `[2016-09-18T00:00:00.000Z TO 2016-09-20T23:59:59.999Z]` and include dates like `2016-09-20T15:32:44`. This behaviour was lost in the cleanups of #8889. Closes #20579
Elasticsearch 1.x used to implicitly round up upper bounds of queries when they were inclusive so that eg. `[2016-09-18 TO 2016-09-20]` would actually run `[2016-09-18T00:00:00.000Z TO 2016-09-20T23:59:59.999Z]` and include dates like `2016-09-20T15:32:44`. This behaviour was lost in the cleanups of #8889. Closes #20579
Elasticsearch 1.x used to implicitly round up upper bounds of queries when they were inclusive so that eg. `[2016-09-18 TO 2016-09-20]` would actually run `[2016-09-18T00:00:00.000Z TO 2016-09-20T23:59:59.999Z]` and include dates like `2016-09-20T15:32:44`. This behaviour was lost in the cleanups of #8889. Closes #20579
Elasticsearch 1.x used to implicitly round up upper bounds of queries when they were inclusive so that eg. `[2016-09-18 TO 2016-09-20]` would actually run `[2016-09-18T00:00:00.000Z TO 2016-09-20T23:59:59.999Z]` and include dates like `2016-09-20T15:32:44`. This behaviour was lost in the cleanups of #8889. Closes #20579
The setting
mapping.date.round_ceil
(and the undocumented settingindex.mapping.date.parse_upper_inclusive
) affect how date ranges usinglte
are parsed. In #8556 the semantics of date rounding weresolidified, eliminating the need to have different parsing functions
whether the date is inclusive or exclusive.
This change removes these legacy settings and improves the tests
for the date math parser (now at 100% coverage!). It also removes the
unnecessary function
DateMathParser.parseTimeZone
for whichthe existing
DateTimeZone.forID
handles all use cases. The one caveatis handling malformed
H:MM
values, but this is a recently addedfeature, and I don't think we should have our own special format here,
but instead enforce the standard
[+-]HH:MM
.Any user previously using these settings can refer to the changed
semantics and change their query accordingly. This is a breaking change
because even dates without datemath previously used the different
parsing functions depending on context.
closes #8598