diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/dataframe/action/PreviewDataFrameTransformAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/dataframe/action/PreviewDataFrameTransformAction.java index 3269d5415f185..188606618011c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/dataframe/action/PreviewDataFrameTransformAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/dataframe/action/PreviewDataFrameTransformAction.java @@ -65,7 +65,7 @@ public static Request fromXContent(final XContentParser parser) throws IOExcepti .createParser(parser.getXContentRegistry(), LoggingDeprecationHandler.INSTANCE, BytesReference.bytes(xContentBuilder).streamInput())) { - return new Request(DataFrameTransformConfig.fromXContent(newParser, "transform-preview", true)); + return new Request(DataFrameTransformConfig.fromXContent(newParser, "transform-preview", false)); } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/test/data_frame/preview_transforms.yml b/x-pack/plugin/src/test/resources/rest-api-spec/test/data_frame/preview_transforms.yml index 3bad56e66bd7c..642a69e57e63f 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/test/data_frame/preview_transforms.yml +++ b/x-pack/plugin/src/test/resources/rest-api-spec/test/data_frame/preview_transforms.yml @@ -88,3 +88,17 @@ setup: - match: { preview.2.airline: foo } - match: { preview.2.by-hour: "2017-02-49 01" } - match: { preview.2.avg_response: 42.0 } + +--- +"Test preview transform with invalid config": + - do: + catch: /\[data_frame_terms_group\] unknown field \[not_a_terms_param\]/ + data_frame.preview_data_frame_transform: + body: > + { + "source": "airline-data", + "pivot": { + "group_by": {"airline": {"terms": {"not_a_terms_param": "airline"}}}, + "aggs": {"avg_response": {"avg": {"field": "responsetime"}}} + } + }