Skip to content

Commit 251514c

Browse files
committed
[ES|QL] Fix suggested_cast yaml test
The wrong capability name was being used in this yaml test causing it to be skipped. This commit fixes that.
1 parent 137eac5 commit 251514c

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,12 @@ public enum Cap {
12151215
/**
12161216
* (Re)Added EXPLAIN command
12171217
*/
1218-
EXPLAIN(Build.current().isSnapshot());
1218+
EXPLAIN(Build.current().isSnapshot()),
1219+
1220+
/**
1221+
* Enable yaml test for suggested cast properly
1222+
*/
1223+
SUGGESTED_CAST_YAML_TEST;
12191224

12201225
private final boolean enabled;
12211226

x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/160_union_types.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -913,8 +913,8 @@ suggested_type:
913913
- method: POST
914914
path: /_query
915915
parameters: []
916-
capabilities: [recommended_cast]
917-
reason: "uses recommended_cast"
916+
capabilities: [suggested_cast_yaml_test]
917+
reason: "was using incorrect capabilities name and being skipped before"
918918

919919
- do:
920920
indices.create:
@@ -969,9 +969,7 @@ suggested_type:
969969
- match: { columns.0.original_types: ["aggregate_metric_double", "long"] }
970970
- match: { columns.0.suggested_cast: "aggregate_metric_double" }
971971
- match: { columns.1.name: "my_date" }
972-
- match: { columns.1.type: "unsupported" }
973-
- match: { columns.1.original_types: ["date_nanos", "datetime"] }
974-
- match: { columns.1.suggested_cast: "date_nanos" }
972+
- match: { columns.1.type: "date_nanos" }
975973
- match: { columns.2.name: "my_double" }
976974
- match: { columns.2.type: "double" }
977975
- is_false: columns.2.original_types

0 commit comments

Comments
 (0)