From: Gord Thompson Date: Tue, 8 Dec 2020 16:49:07 +0000 (-0700) Subject: Reformatted test_compiler.py; added changelog file X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7f95da8abf717b5d021d22cd1444a6c8755cc09e;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Reformatted test_compiler.py; added changelog file --- diff --git a/doc/build/changelog/unreleased_13/5751.rst b/doc/build/changelog/unreleased_13/5751.rst new file mode 100644 index 0000000000..44306ceb3d --- /dev/null +++ b/doc/build/changelog/unreleased_13/5751.rst @@ -0,0 +1,7 @@ +.. change:: + :tags: bug, mssql + :tickets: 5751 + + Fixed bug where a CREATE INDEX statement was rendered incorrectly when + both ``mssql-include`` and ``mssql_where`` were specified. Pull request + courtesy @Adiorz. diff --git a/test/dialect/mssql/test_compiler.py b/test/dialect/mssql/test_compiler.py index eea4011899..756223b6e8 100644 --- a/test/dialect/mssql/test_compiler.py +++ b/test/dialect/mssql/test_compiler.py @@ -1290,18 +1290,20 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): Column("y", Integer), Column("z", Integer), ) - idx = Index("foo", tbl.c.x, mssql_include=[tbl.c.y], - mssql_where=tbl.c.y > 1) + idx = Index( + "foo", tbl.c.x, mssql_include=[tbl.c.y], mssql_where=tbl.c.y > 1 + ) self.assert_compile( schema.CreateIndex(idx), - "CREATE INDEX foo ON test (x) INCLUDE (y) WHERE y > 1" + "CREATE INDEX foo ON test (x) INCLUDE (y) WHERE y > 1", ) - idx = Index("foo", tbl.c.x, mssql_include=[tbl.c.y], - mssql_where="y > 1") + idx = Index( + "foo", tbl.c.x, mssql_include=[tbl.c.y], mssql_where="y > 1" + ) self.assert_compile( schema.CreateIndex(idx), - "CREATE INDEX foo ON test (x) INCLUDE (y) WHERE y > 1" + "CREATE INDEX foo ON test (x) INCLUDE (y) WHERE y > 1", ) def test_try_cast(self):