Skip to content

TestTrainSQL test is failing #1283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
publicwlj opened this issue Dec 1, 2019 · 7 comments · Fixed by #1343
Open

TestTrainSQL test is failing #1283

publicwlj opened this issue Dec 1, 2019 · 7 comments · Fixed by #1343
Assignees

Comments

@publicwlj
Copy link
Contributor

publicwlj commented Dec 1, 2019

Error message:

=== RUN   TestEnd2EndMySQL/TestTrainSQL
time="2019-12-01T04:19:48Z" level=info msg="sqlflowCmd: run locally" package=sql
time="2019-12-01T04:20:00Z" level=info msg="sqlflowCmd: run locally" package=sql
time="2019-12-01T04:20:05Z" level=error msg="runSQLProgram error: failed: exit status 1
...
Traceback (most recent call last):
  File "<stdin>", line 91, in <module>
  File "/miniconda/envs/sqlflow-dev/lib/python3.6/site-packages/sqlflow_submitter/tensorflow/predict.py", line 194, in pred
    w.write(row)
  File "/miniconda/envs/sqlflow-dev/lib/python3.6/contextlib.py", line 88, in __exit__
    next(self.gen)
  File "/miniconda/envs/sqlflow-dev/lib/python3.6/site-packages/sqlflow_submitter/db.py", line 224, in buffered_db_writer
    w.close()
  File "/miniconda/envs/sqlflow-dev/lib/python3.6/site-packages/sqlflow_submitter/db_writer/base.py", line 36, in close
    self.flush()
  File "/miniconda/envs/sqlflow-dev/lib/python3.6/site-packages/sqlflow_submitter/db_writer/mysql.py", line 27, in flush
    cursor.executemany(statement, self.rows)
  File "/miniconda/envs/sqlflow-dev/lib/python3.6/site-packages/MySQLdb/cursors.py", line 237, in executemany
    self._get_db().encoding)
  File "/miniconda/envs/sqlflow-dev/lib/python3.6/site-packages/MySQLdb/cursors.py", line 264, in _do_execute_many
    rows += self.execute(sql + postfix)
  File "/miniconda/envs/sqlflow-dev/lib/python3.6/site-packages/MySQLdb/cursors.py", line 209, in execute
    res = self._query(query)
  File "/miniconda/envs/sqlflow-dev/lib/python3.6/site-packages/MySQLdb/cursors.py", line 315, in _query
    db.query(q)
  File "/miniconda/envs/sqlflow-dev/lib/python3.6/site-packages/MySQLdb/connections.py", line 226, in query
    _mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1054, "Unknown column 'sepal_length' in 'field list'")
FAIL	sqlflow.org/sqlflow/cmd/sqlflowserver

this error always happens. I follow the tutorial to start the container and then run all the tests in mac environment.

@typhoonzero
Copy link
Collaborator

Can you please check out the content of the tableiris.predict and try describe iris.predict?

@publicwlj
Copy link
Contributor Author

Can you please check out the content of the tableiris.predict and try describe iris.predict?

image

@typhoonzero
Copy link
Collaborator

I'm sorry but I can not reproduce this issue, I am using the latest sqlflow/sqlflow Docker image to run the tests. What's your environment?

If you are using Docker already, can you please try using the script scripts/test_units.sh to run all the tests, this script contains helpful environment settings before running go test.

@publicwlj
Copy link
Contributor Author

It is ok using the script scripts/test_units.sh to run all the tests. I find something different. my command is 'SQLFLOW_TEST_DB=mysql go test -v ./...', but the command in the script is 'SQLFLOW_TEST_DB=mysql go test -v -p 1 ./...'.
the reason is like this (ref). so i think we need update the tutorial with adding -p 1 parameter.

@typhoonzero
Copy link
Collaborator

Thanks, will do that~

@wangkuiyi
Copy link
Collaborator

I re-thought about this issue. Thanks to @publicwlj for pointing this out. A complete solution to this issue seems to remove the necessity to run tests sequentially with -p 1. To do that, we could follow #1037 (comment).

@wangkuiyi
Copy link
Collaborator

Related to #1495

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants