]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Reformatted test_compiler.py; added changelog file
authorGord Thompson <gord@gordthompson.com>
Tue, 8 Dec 2020 16:49:07 +0000 (09:49 -0700)
committerGord Thompson <gord@gordthompson.com>
Tue, 8 Dec 2020 16:49:07 +0000 (09:49 -0700)
doc/build/changelog/unreleased_13/5751.rst [new file with mode: 0644]
test/dialect/mssql/test_compiler.py

diff --git a/doc/build/changelog/unreleased_13/5751.rst b/doc/build/changelog/unreleased_13/5751.rst
new file mode 100644 (file)
index 0000000..44306ce
--- /dev/null
@@ -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.
index eea401189903c5b226d2c5b4cf6f1460505098ca..756223b6e8ff6e7d5687f2e3ec2c6329b68be161 100644 (file)
@@ -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):