Skip to content

Commit

Permalink
[ML] Adapt Inference actions for backport and reenable BWC
Browse files Browse the repository at this point in the history
Due to #92819
  • Loading branch information
davidkyle authored Jan 11, 2023
1 parent fa58477 commit 3a8fdf1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ tasks.register("verifyVersions") {
* after the backport of the backcompat code is complete.
*/

boolean bwc_tests_enabled = false
boolean bwc_tests_enabled = true
// place a PR link here when committing bwc changes:
String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/92359"
String bwc_tests_disabled_issue = ""
if (bwc_tests_enabled == false) {
if (bwc_tests_disabled_issue.isEmpty()) {
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ public Response(List<InferenceResults> results) {
public Response(StreamInput in) throws IOException {
super(in);

// Multiple results added in 8.7.0
if (in.getVersion().onOrAfter(Version.V_8_7_0)) {
// Multiple results added in 8.6.1
if (in.getVersion().onOrAfter(Version.V_8_6_1)) {
results = in.readNamedWriteableList(InferenceResults.class);
} else {
results = List.of(in.readNamedWriteable(InferenceResults.class));
Expand All @@ -341,7 +341,7 @@ public Response(StreamInput in) throws IOException {
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);

if (out.getVersion().onOrAfter(Version.V_8_7_0)) {
if (out.getVersion().onOrAfter(Version.V_8_6_1)) {
out.writeNamedWriteableList(results);
} else {
out.writeNamedWriteable(results.get(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected InferTrainedModelDeploymentAction.Response mutateInstanceForVersion(
InferTrainedModelDeploymentAction.Response instance,
Version version
) {
if (version.before(Version.V_8_7_0)) {
if (version.before(Version.V_8_6_1)) {
return new InferTrainedModelDeploymentAction.Response(instance.getResults().subList(0, 1));
}

Expand Down

0 comments on commit 3a8fdf1

Please sign in to comment.