Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Fix Get trained models statistics API types #2763
Fix Get trained models statistics API types #2763
Changes from 2 commits
7303fc3
9563caa
cabc6a3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
DateTime
might have been correct here, as it's defined as:We have to check the server-code in order to verify if it should be
DateTime
or justEpochTime<UnitMillis>
.In any way:
The .NET client correctly uses
DateTimeOffset
as the CLR type, but fails to deserialize it from the epoch-time representation. This is something that must be fixed on the client itself and not in the spec.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.
interesting, in this case it seems
EpochTime<UnitMillis>
is the right type. I've checked other classes that use the same kind of value likestart_time_in_millis
of AsyncSearchResponseBase and it uses EpochTime for the one that is long. (I don't find any example of thestart_time
field in the tests I've done nor in https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html).I'll set the field to be EpochTime for now until you find the right answer or fix for the .net client.
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.
Yes, this seems right. I think this should be the corresponding server code:
https://github.com/elastic/elasticsearch/blob/02c494963a59610a0be07c7d54337017a1e5beaf/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/TrainedModelStatsService.java#L282C58-L282C106
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.
so
EpochTime<UnitMillis>
looks good? anything else to address in this PR?