Skip to content

Commit 84bdb12

Browse files
committed
Apply review comments
1 parent 7fa69df commit 84bdb12

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/cat/RestCatDataFrameAnalyticsAction.java

+9-4
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,17 @@ private static Table getTableWithHeader() {
9292
.startHeaders()
9393
// DFA config info
9494
.addCell("id", TableColumnAttributeBuilder.builder("the id").build())
95+
.addCell("type",
96+
TableColumnAttributeBuilder.builder("analysis type")
97+
.setAliases("t")
98+
.build())
9599
.addCell("create_time",
96100
TableColumnAttributeBuilder.builder("job creation time")
97101
.setAliases("ct", "createTime")
98102
.build())
99-
.addCell("type",
100-
TableColumnAttributeBuilder.builder("analysis type")
101-
.setAliases("t")
103+
.addCell("version",
104+
TableColumnAttributeBuilder.builder("the version of Elasticsearch when the analytics was created", false)
105+
.setAliases("v")
102106
.build())
103107
.addCell("source_index",
104108
TableColumnAttributeBuilder.builder("source index", false)
@@ -164,8 +168,9 @@ private static Table buildTable(GetDataFrameAnalyticsAction.Response getResponse
164168
table
165169
.startRow()
166170
.addCell(config.getId())
167-
.addCell(config.getCreateTime())
168171
.addCell(config.getAnalysis().getWriteableName())
172+
.addCell(config.getCreateTime())
173+
.addCell(config.getVersion())
169174
.addCell(String.join(",", config.getSource().getIndex()))
170175
.addCell(config.getDest().getIndex())
171176
.addCell(config.getDescription())

x-pack/plugin/src/test/resources/rest-api-spec/test/ml/data_frame_analytics_cat_apis.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ setup:
4646
id: dfa-outlier-detection-job
4747
- match:
4848
$body: |
49-
/ #id create_time type state
50-
^ (dfa\-outlier\-detection\-job \s+ [^\s]+ \s+ outlier_detection \s+ stopped \n)+ $/
49+
/ #id type create_time state
50+
^ (dfa\-outlier\-detection\-job \s+ outlier_detection \s+ [^\s]+ \s+ stopped \n)+ $/
5151
5252
---
5353
"Test cat data frame analytics single job with header":
@@ -57,8 +57,8 @@ setup:
5757
v: true
5858
- match:
5959
$body: |
60-
/^ id \s+ create_time \s+ type \s+ state \n
61-
(dfa\-outlier\-detection\-job \s+ [^\s]+ \s+ outlier_detection \s+ stopped \n)+ $/
60+
/^ id \s+ type \s+ create_time \s+ state \n
61+
(dfa\-outlier\-detection\-job \s+ outlier_detection \s+ [^\s]+ \s+ stopped \n)+ $/
6262
6363
---
6464
"Test cat data frame analytics all jobs with header":
@@ -67,10 +67,10 @@ setup:
6767
v: true
6868
- match:
6969
$body: |
70-
/^ id \s+ create_time \s+ type \s+ state \n
71-
(dfa\-classification\-job \s+ [^\s]+ \s+ classification \s+ stopped \n)+
72-
(dfa\-outlier\-detection\-job \s+ [^\s]+ \s+ outlier_detection \s+ stopped \n)+
73-
(dfa\-regression\-job \s+ [^\s]+ \s+ regression \s+ stopped \n)+ $/
70+
/^ id \s+ type \s+ create_time \s+ state \n
71+
(dfa\-classification\-job \s+ classification \s+ [^\s]+ \s+ stopped \n)+
72+
(dfa\-outlier\-detection\-job \s+ outlier_detection \s+ [^\s]+ \s+ stopped \n)+
73+
(dfa\-regression\-job \s+ regression \s+ [^\s]+ \s+ stopped \n)+ $/
7474
7575
---
7676
"Test cat data frame analytics all jobs with header and column selection":

0 commit comments

Comments
 (0)