Skip to content

Commit d635bf2

Browse files
committed
remove TO before TRAIN/ANALYZE in ut
1 parent 3e8324c commit d635bf2

File tree

2 files changed

+14
-23
lines changed

2 files changed

+14
-23
lines changed

pkg/sql/ir_generator_test.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,11 @@ func TestGeneratePredictIR(t *testing.T) {
158158
}
159159
a := assert.New(t)
160160
parser := newParser()
161-
predSQL := `SELECT * FROM iris.test
162-
TO PREDICT iris.predict.class
163-
USING sqlflow_models.mymodel;`
161+
predSQL := `
162+
SELECT * FROM iris.test
163+
PREDICT iris.predict.class
164+
USING sqlflow_models.mymodel;
165+
`
164166
r, e := parser.Parse(predSQL)
165167
a.NoError(e)
166168

@@ -170,12 +172,14 @@ USING sqlflow_models.mymodel;`
170172
modelDir, e := ioutil.TempDir("/tmp", "sqlflow_models")
171173
a.Nil(e)
172174
defer os.RemoveAll(modelDir)
173-
stream := runExtendedSQL(`SELECT * FROM iris.train
174-
TO TRAIN DNNClassifier
175-
WITH model.n_classes=3, model.hidden_units=[10,20]
176-
COLUMN sepal_length, sepal_width, petal_length, petal_width
177-
LABEL class
178-
INTO sqlflow_models.mymodel;`, testDB, modelDir, nil)
175+
stream := runExtendedSQL(`
176+
SELECT * FROM iris.train
177+
TRAIN DNNClassifier
178+
WITH model.n_classes=3, model.hidden_units=[10,20]
179+
COLUMN sepal_length, sepal_width, petal_length, petal_width
180+
LABEL class
181+
INTO sqlflow_models.mymodel;
182+
`, testDB, modelDir, nil)
179183
a.True(goodStream(stream.ReadAll()))
180184

181185
// Test generate PredicrIR
@@ -206,7 +210,7 @@ func TestGenerateAnalyzeIR(t *testing.T) {
206210
stream := runExtendedSQL(`
207211
SELECT *
208212
FROM iris.train
209-
TO TRAIN xgboost.gbtree
213+
TRAIN xgboost.gbtree
210214
WITH
211215
objective="multi:softprob",
212216
train.num_boost_round = 30,

pkg/sql/parser.go

Lines changed: 0 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)