Skip to content

Commit 14547b1

Browse files
[ML] Add changes stats fields as exception in mappings upgrade test (#62121)
Following #61980 we need to exclude the replaced fields in the test in the 7.x branch.
1 parent 18a08c0 commit 14547b1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/MlMappingsUpgradeIT.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,18 @@ private void assertMappingsMatchTemplates() throws IOException {
179179
configIndexExceptions.add("properties.last_data_time.type");
180180
configIndexExceptions.add("properties.types.type");
181181

182+
// Excluding those from stats index as some have been renamed and other removed.
183+
Set<String> statsIndexException = new HashSet<>();
184+
statsIndexException.add("properties.hyperparameters.properties.regularization_depth_penalty_multiplier.type");
185+
statsIndexException.add("properties.hyperparameters.properties.regularization_leaf_weight_penalty_multiplier.type");
186+
statsIndexException.add("properties.hyperparameters.properties.regularization_soft_tree_depth_limit.type");
187+
statsIndexException.add("properties.hyperparameters.properties.regularization_soft_tree_depth_tolerance.type");
188+
statsIndexException.add("properties.hyperparameters.properties.regularization_tree_size_penalty_multiplier.type");
189+
182190
assertLegacyTemplateMatchesIndexMappings(".ml-config", ".ml-config", false, configIndexExceptions);
183191
// the true parameter means the index may not have been created
184192
assertLegacyTemplateMatchesIndexMappings(".ml-meta", ".ml-meta", true, Collections.emptySet());
185-
assertLegacyTemplateMatchesIndexMappings(".ml-stats", ".ml-stats-000001", true, Collections.emptySet());
193+
assertLegacyTemplateMatchesIndexMappings(".ml-stats", ".ml-stats-000001", true, statsIndexException);
186194
assertLegacyTemplateMatchesIndexMappings(".ml-state", ".ml-state-000001");
187195
assertLegacyTemplateMatchesIndexMappings(".ml-notifications-000001", ".ml-notifications-000001");
188196
assertLegacyTemplateMatchesIndexMappings(".ml-inference-000003", ".ml-inference-000003", true, Collections.emptySet());

0 commit comments

Comments
 (0)