-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Esql additional date format testing #120000
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
Esql additional date format testing #120000
Conversation
Documentation preview: |
Pinging @elastic/es-analytical-engine (Team:Analytics) |
) | ||
public DateFormat( | ||
Source source, | ||
@Param(optional = true, name = "dateFormat", type = { "keyword", "text" }, description = """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first positional argument can be a date, in the one parameter version of the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's quite a weird way to do it, but that's how the tests work.
We could, optionally, hack around this in the tests somehow. Or teach them about first position optional arguments. It's just that we don't have that many!
*/ | ||
public static List<TypedDataSupplier> dateFormatCases() { | ||
return List.of( | ||
new TypedDataSupplier("<format as KEYWORD>", () -> new BytesRef(ESTestCase.randomDateFormatterPattern()), DataType.KEYWORD), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only generates the named formats, as far as I can tell. Would be good to write something that generates arbitrary format strings too, but I didn't see such a thing and this is still more coverage than we had.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's an improvement. I agree the extra thing on the parameter is lame.
) | ||
public DateFormat( | ||
Source source, | ||
@Param(optional = true, name = "dateFormat", type = { "keyword", "text" }, description = """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's quite a weird way to do it, but that's how the tests work.
We could, optionally, hack around this in the tests somehow. Or teach them about first position optional arguments. It's just that we don't have that many!
💚 Backport successful
|
This wires up the randomized testing for DateFormat. Prior to this PR, none of the randomized testing was hitting the one parameter version of the function, so I wired that up as well. This required some compromises on the type signatures, see comments in line.less --------- Co-authored-by: elasticsearchmachine <[email protected]>
This wires up the randomized testing for DateFormat. Prior to this PR, none of the randomized testing was hitting the one parameter version of the function, so I wired that up as well. This required some compromises on the type signatures, see comments in line.less --------- Co-authored-by: elasticsearchmachine <[email protected]>
This wires up the randomized testing for DateFormat. Prior to this PR, none of the randomized testing was hitting the one parameter version of the function, so I wired that up as well. This required some compromises on the type signatures, see comments in line.less --------- Co-authored-by: elasticsearchmachine <[email protected]>
This wires up the randomized testing for
DateFormat
. Prior to this PR, none of the randomized testing was hitting the one parameter version of the function, so I wired that up as well. This required some compromises on the type signatures, see comments in line.