Skip to content
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

[ML] fix model snapshot sorting when sorting by min_version #80596

Merged
merged 1 commit into from
Nov 10, 2021

Conversation

benwtrent
Copy link
Member

When handling the missing field in sort builder, Version shouldn't be added directly, instead a string representation of the version concerned.

closes: #80561

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@benwtrent benwtrent force-pushed the feature/ml-fix-issue-80561 branch from 230bd8c to f2f7937 Compare November 10, 2021 13:12
@benwtrent
Copy link
Member Author

This shows that the deprecation checker should have multi-node tests :(.

Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@przemekwitek przemekwitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

.from(from)
.size(size)
.trackTotalHits(true)
.fetchSource(REMOVE_QUANTILES_FROM_SOURCE);
SearchRequest searchRequest = new SearchRequest(indexName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this fluent builder pattern be used here too?

        SearchRequest searchRequest = new SearchRequest(indexName)
            .indicesOptions(...)
            .source(...)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No necessarily, we use the default indices options created in the request.

GetModelSnapshotsAction.Request request = new GetModelSnapshotsAction.Request(jobId, null);
request.setSort("min_version");
// Should not throw
client().execute(GetModelSnapshotsAction.INSTANCE, request).actionGet();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to add an assertion on the result?
Or are we satisfied just knowing it doesn't throw?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, it threw a search exception. I am satisfied (for expediency) for now.

@benwtrent benwtrent merged commit 08324ed into elastic:master Nov 10, 2021
@benwtrent benwtrent deleted the feature/ml-fix-issue-80561 branch November 10, 2021 14:10
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Nov 10, 2021
…80596)

When handling the missing field in sort builder, Version shouldn't be added directly, instead a string representation of the version concerned.

closes: elastic#80561
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Nov 10, 2021
…80596)

When handling the missing field in sort builder, Version shouldn't be added directly, instead a string representation of the version concerned.

closes: elastic#80561
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.0
7.16

elasticsearchmachine pushed a commit that referenced this pull request Nov 10, 2021
…80599)

When handling the missing field in sort builder, Version shouldn't be added directly, instead a string representation of the version concerned.

closes: #80561
elasticsearchmachine pushed a commit that referenced this pull request Nov 10, 2021
…80596) (#80600)

* [ML] fix model snapshot sorting when sorting by min_version (#80596)

When handling the missing field in sort builder, Version shouldn't be added directly, instead a string representation of the version concerned.

closes: #80561

* adding back import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :ml Machine learning Team:ML Meta label for the ML team v7.16.0 v8.0.0-rc1 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

can not write type [class org.elasticsearch.Version]
7 participants