Skip to content

Commit fc08752

Browse files
authored
Fix pai maxcompute tests (#2501)
* WIP fix pai maxcompute tests * wip should update models version * update models version
1 parent 6fcfbad commit fc08752

5 files changed

Lines changed: 13 additions & 2 deletions

File tree

cmd/sqlflowserver/e2e_pai_maxcompute_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,10 @@ func TestEnd2EndMaxComputePAI(t *testing.T) {
478478
// write model to current MaxCompute project
479479
caseInto = "my_dnn_model"
480480

481+
if err := prepareTestData(dbConnStr); err != nil {
482+
t.FailNow()
483+
}
484+
481485
go start(modelDir, caCrt, caKey, unitTestPort, false)
482486
server.WaitPortReady(fmt.Sprintf("localhost:%d", unitTestPort), 0)
483487

docker/dev/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ if [[ ! -d models ]]; then
7272
fi
7373
cd models
7474
git fetch origin # The residual local repo might not be on a branch.
75-
git checkout v0.0.3 -b v0.0.3
75+
git checkout v0.0.4 -b v0.0.4
7676
python setup.py bdist_wheel -q --dist-dir $SQLFLOW_BIN > /dev/null
7777

7878
echo "Convert tutorials from Markdown to IPython notebooks ..."

pkg/codegen/pai/template_tf.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,14 @@ sklearn2pmml==0.56.0
144144
const tfPredictTmplText = tfImportsText + `
145145
import os
146146
import types
147+
import traceback
147148
from sqlflow_submitter.tensorflow import predict
148149
149150
try:
150151
import sqlflow_models
151152
except Exception as e:
152153
print("error importing sqlflow_models: %s" % e)
154+
traceback.print_exc()
153155
try:
154156
tf.enable_eager_execution()
155157
except:

pkg/codegen/tensorflow/template_train.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ type trainFiller struct {
3737

3838
const tfTrainTemplateText = `
3939
import copy
40+
import traceback
4041
import tensorflow as tf
4142
import sqlflow_submitter
4243
from sqlflow_submitter.tensorflow.train import train
@@ -59,6 +60,7 @@ try:
5960
import sqlflow_models
6061
except Exception as e:
6162
print("failed to import sqlflow_models: %s", e)
63+
traceback.print_exc()
6264
6365
feature_column_names = [{{range $target, $desclist := .FieldDescs}}{{range $desclist}}
6466
"{{.Name}}",

python/sqlflow_submitter/tensorflow/keras_with_feature_column_input.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ def init_model_with_feature_column(estimator,
3838
NOTE: initalize estimator model can also use this function since estimators all have
3939
"feature_column" argument.
4040
"""
41-
argspec = inspect.getargspec(estimator)
41+
if inspect.isclass(estimator):
42+
argspec = inspect.getargspec(estimator.__init__)
43+
else:
44+
argspec = inspect.getargspec(estimator)
4245
if "feature_columns" not in argspec.args and not has_none_optimizer:
4346
feature_columns = model_params["feature_columns"]
4447
del model_params["feature_columns"]

0 commit comments

Comments
 (0)