Closed mcepl closed 3 years ago
I think I've now corrected this issue in version 0.5.6.
Hi, the test still fails in 0.5.6, but with a slightly different message:
[ 25s] =================================== FAILURES ===================================
[ 25s] _______________ TestSQL.test_to_sql_create_statement_with_schema _______________
[ 25s]
[ 25s] self = <tests.test_agatesql.TestSQL testMethod=test_to_sql_create_statement_with_schema>
[ 25s]
[ 25s] def test_to_sql_create_statement_with_schema(self):
[ 25s] statement = self.table.to_sql_create_statement('test_table', db_schema='test_schema', dialect='mysql')
[ 25s]
[ 25s] self.assertEqual(statement.replace('\t', ' '), '''CREATE TABLE test_schema.test_table (
[ 25s] number DECIMAL(38, 3),
[ 25s] textcol VARCHAR(1) NOT NULL,
[ 25s] boolean BOOL,
[ 25s] date DATE,
[ 25s] datetime TIMESTAMP NULL,
[ 25s] CHECK (boolean IN (0, 1))
[ 25s] > );''') # noqa
[ 25s] E AssertionError: 'CREA[126 chars]\n datetime TIMESTAMP NULL\n);' != 'CREA[126 chars]\n datetime TIMESTAMP NULL, \n CHECK (boolean IN (0, 1))\n);'
[ 25s] E CREATE TABLE test_schema.test_table (
[ 25s] E number DECIMAL(38, 3),
[ 25s] E textcol VARCHAR(1) NOT NULL,
[ 25s] E boolean BOOL,
[ 25s] E date DATE,
[ 25s] E - datetime TIMESTAMP NULL
[ 25s] E + datetime TIMESTAMP NULL,
[ 25s] E ? ++
[ 25s] E + CHECK (boolean IN (0, 1))
[ 25s] E );
[ 25s]
Confirming https://github.com/wireservice/agate-sql/issues/33#issuecomment-871252304 . Please, reopen.
Confirmed in CI: https://github.com/wireservice/agate-sql/runs/3051849209
Fixed. Thanks for reporting!
thanks a lot! I think the failure was due to new version of something, it would be eventually nice to find out what changed and document it if you find some spare time :)
Yes, I plan to dig into it - it's not clear what changed.
It looks like SQLAlchemy used to add a constraint on boolean fields, but possibly, in the MySQL dialect used by the test, such a constraint is not mandatory.
When packaging agate-sql for openSUSE, the test suite fails with this failure (using Python 3.6):
Full build log with all details of the process and versions of all packages used.