From: jonathan vanasco Date: Wed, 28 Oct 2020 19:58:55 +0000 (-0400) Subject: while working on #5435, I found some misses from the previous PR for #5429 X-Git-Tag: rel_1_4_0b1~9^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5676%2Fhead;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git while working on #5435, I found some misses from the previous PR for #5429 Change-Id: I0be15f6234c74302734672450a3275add762bdb8 --- diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py index e4f7532bed..1bea973188 100644 --- a/lib/sqlalchemy/sql/util.py +++ b/lib/sqlalchemy/sql/util.py @@ -599,14 +599,14 @@ def adapt_criterion_to_null(crit, nulls): binary.left = binary.right binary.right = Null() binary.operator = operators.is_ - binary.negate = operators.isnot + binary.negate = operators.is_not elif ( isinstance(binary.right, BindParameter) and binary.right._identifying_key in nulls ): binary.right = Null() binary.operator = operators.is_ - binary.negate = operators.isnot + binary.negate = operators.is_not return visitors.cloned_traverse(crit, {}, {"binary": visit_binary}) diff --git a/lib/sqlalchemy/testing/suite/test_select.py b/lib/sqlalchemy/testing/suite/test_select.py index d15fae3c47..954900f67a 100644 --- a/lib/sqlalchemy/testing/suite/test_select.py +++ b/lib/sqlalchemy/testing/suite/test_select.py @@ -1367,7 +1367,7 @@ class IsOrIsNotDistinctFromTest(fixtures.TablesTest): expected_row_count_for_is, ) - expected_row_count_for_isnot = ( + expected_row_count_for_is_not = ( 1 if expected_row_count_for_is == 0 else 0 ) result = connection.execute( @@ -1375,5 +1375,5 @@ class IsOrIsNotDistinctFromTest(fixtures.TablesTest): ).fetchall() eq_( len(result), - expected_row_count_for_isnot, + expected_row_count_for_is_not, ) diff --git a/test/dialect/mysql/test_query.py b/test/dialect/mysql/test_query.py index e23ff00d0d..f9d9caf166 100644 --- a/test/dialect/mysql/test_query.py +++ b/test/dialect/mysql/test_query.py @@ -34,7 +34,7 @@ class IdiosyncrasyTest(fixtures.TestBase): ) is_( - connection.scalar(select(cast(true().isnot(true()), Boolean))), + connection.scalar(select(cast(true().is_not(true()), Boolean))), False, )