-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Catch DateTimeException in EsqlDataTypeConverter #137744
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
base: main
Are you sure you want to change the base?
Conversation
|
I'm not familiar with ESQL to know how this should be tested |
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
|
Hi @thecoop, I've created a changelog YAML for you. |
|
Thanks for the fix! About testing, 2 ways (we usually do both:
Lines 137 to 155 in f40259a
It should automatically test both folding and runtime evaluating cases. Then, we would add a CSV test with the failing query (Like elasticsearch/x-pack/plugin/esql/qa/testFixtures/src/main/resources/date.csv-spec Lines 509 to 516 in a328b58
Also, these affect multiple code paths, which are used by multiple functions too:
Those are the ones I found at least, maybe you can track some other important code. It would be nice to have both unit tests and CSV tests for them. About the fix per se, should we have the check inside the DateFormatter class/sub-class? I think that would fix the ToDateNanos case too, but not sure. |
|
|
|
I've added a few tests - not sure how thorough this needs to be though |
DateTimeExceptionis not a fatal exception, it is an input error, so convert it toIllegalArgumentExceptionFixes #137741