Skip to content

Commit

Permalink
[ML] Adjust versions and unmute DFA bwc tests (#69294)
Browse files Browse the repository at this point in the history
... after backporting #69183
  • Loading branch information
dimitris-athanasiou authored Feb 20, 2021
1 parent 333e5cf commit 1256558
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package org.elasticsearch.xpack.core.ml.dataframe;

import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.Version;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.Strings;
Expand Down Expand Up @@ -89,16 +88,8 @@ public DataFrameAnalyticsSource(String[] index, @Nullable QueryProvider queryPro
public DataFrameAnalyticsSource(StreamInput in) throws IOException {
index = in.readStringArray();
queryProvider = QueryProvider.fromStream(in);
if (in.getVersion().onOrAfter(Version.V_7_6_0)) {
sourceFiltering = in.readOptionalWriteable(FetchSourceContext::new);
} else {
sourceFiltering = null;
}
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
runtimeMappings = in.readMap();
} else {
runtimeMappings = Collections.emptyMap();
}
sourceFiltering = in.readOptionalWriteable(FetchSourceContext::new);
runtimeMappings = in.readMap();
}

public DataFrameAnalyticsSource(DataFrameAnalyticsSource other) {
Expand All @@ -113,12 +104,8 @@ public DataFrameAnalyticsSource(DataFrameAnalyticsSource other) {
public void writeTo(StreamOutput out) throws IOException {
out.writeStringArray(index);
queryProvider.writeTo(out);
if (out.getVersion().onOrAfter(Version.V_7_6_0)) {
out.writeOptionalWriteable(sourceFiltering);
}
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
out.writeMap(runtimeMappings);
}
out.writeOptionalWriteable(sourceFiltering);
out.writeMap(runtimeMappings);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ public static DataFrameAnalyticsSource createRandom() {
}

public static DataFrameAnalyticsSource mutateForVersion(DataFrameAnalyticsSource instance, Version version) {
if (version.before(Version.V_7_6_0)) {
return new DataFrameAnalyticsSource(instance.getIndex(), instance.getQueryProvider(), null, null);
}
if (version.before(Version.V_8_0_0)) {
return new DataFrameAnalyticsSource(instance.getIndex(), instance.getQueryProvider(), instance.getSourceFiltering(), null);
}
return instance;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
setup:
- skip:
version: "all"
reason: "Until backport of https://github.com/elastic/elasticsearch/pull/69183"

---
"Get old outlier_detection job":

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
setup:
- skip:
version: "all"
reason: "Until backport of https://github.com/elastic/elasticsearch/pull/69183"

- do:
index:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
setup:
- skip:
version: "all"
reason: "Until backport of https://github.com/elastic/elasticsearch/pull/69183"

---
"Get old cluster outlier_detection job":

Expand Down

0 comments on commit 1256558

Please sign in to comment.