Skip to content

Commit b3c95cd

Browse files
FieldType for random tests should return null for custom type (#133271)
The data generation framework allows the use of custom types. When attempting to parse the type name into a FieldType, this should return null, which will cause downstream users to skip this type. Fixes #133202 Co-authored-by: Alan Woodward <[email protected]>
1 parent f84ec74 commit b3c95cd

File tree

1 file changed

+2
-1
lines changed
  • test/framework/src/main/java/org/elasticsearch/datageneration

1 file changed

+2
-1
lines changed

test/framework/src/main/java/org/elasticsearch/datageneration/FieldType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ public static FieldType tryParse(String name) {
108108
case "wildcard" -> FieldType.WILDCARD;
109109
case "passthrough" -> FieldType.PASSTHROUGH;
110110
case "match_only_text" -> FieldType.MATCH_ONLY_TEXT;
111-
default -> throw new IllegalArgumentException("Unknown field type: " + name);
111+
// Custom types will fail to parse and will return null
112+
default -> null;
112113
};
113114
}
114115

0 commit comments

Comments
 (0)