]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
run black code formatter 8496/head
authorMatias Martinez Rebori <matias.martinez@dinapi.gov.py>
Wed, 7 Sep 2022 16:21:49 +0000 (12:21 -0400)
committerMatias Martinez Rebori <matias.martinez@dinapi.gov.py>
Wed, 7 Sep 2022 16:21:49 +0000 (12:21 -0400)
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/operators.py
test/sql/test_operators.py

index d11e5a0406b04ec2365f9f27bdfdca112db0b09c..bc759da27b6aeccdff99d8ca30d4b520140cc35e 100644 (file)
@@ -2704,16 +2704,18 @@ class SQLCompiler(Compiled):
         binary = binary._clone()
         percent = self._like_percent_literal
         binary.left = functions.func.lower(binary.left)
-        binary.right = percent.concat(functions.func.lower(binary.right)).\
-            concat(percent)
+        binary.right = percent.concat(
+            functions.func.lower(binary.right)
+        ).concat(percent)
         return self.visit_like_op_binary(binary, operator, **kw)
 
     def visit_not_icontains_op_binary(self, binary, operator, **kw):
         binary = binary._clone()
         percent = self._like_percent_literal
         binary.left = functions.func.lower(binary.left)
-        binary.right = percent.concat(functions.func.lower(binary.right)).\
-            concat(percent)
+        binary.right = percent.concat(
+            functions.func.lower(binary.right)
+        ).concat(percent)
         return self.visit_not_like_op_binary(binary, operator, **kw)
 
     def visit_startswith_op_binary(self, binary, operator, **kw):
index 4f1d097c662638519351d9bdab8fee4f7967e6c6..49cf05f8defc3c71568ec34fc4a39fcda82b9e26 100644 (file)
@@ -967,10 +967,10 @@ class ColumnOperators(Operators):
         )
 
     def istartswith(
-            self,
-            other: Any,
-            escape: Optional[str] = None,
-            autoescape: bool = False,
+        self,
+        other: Any,
+        escape: Optional[str] = None,
+        autoescape: bool = False,
     ) -> ColumnOperators:
         r"""Implement the ``istartswith`` operator, e.g. case insensitive
         version of :meth:`.ColumnOperators.startswith`.
@@ -1135,10 +1135,10 @@ class ColumnOperators(Operators):
         )
 
     def iendswith(
-            self,
-            other: Any,
-            escape: Optional[str] = None,
-            autoescape: bool = False,
+        self,
+        other: Any,
+        escape: Optional[str] = None,
+        autoescape: bool = False,
     ) -> ColumnOperators:
         r"""Implement the ``iendswith`` operator, e.g. case insensitive
         version of :meth:`.ColumnOperators.endswith`.
@@ -1930,7 +1930,7 @@ notstartswith_op = not_startswith_op
 @comparison_op
 @_operator_fn
 def istartswith_op(
-        a: Any, b: Any, escape: Optional[str] = None, autoescape: bool = False
+    a: Any, b: Any, escape: Optional[str] = None, autoescape: bool = False
 ) -> Any:
     return _escaped_like_impl(a.istartswith, b, escape, autoescape)
 
@@ -1938,7 +1938,7 @@ def istartswith_op(
 @comparison_op
 @_operator_fn
 def not_istartswith_op(
-        a: Any, b: Any, escape: Optional[str] = None, autoescape: bool = False
+    a: Any, b: Any, escape: Optional[str] = None, autoescape: bool = False
 ) -> Any:
     return ~_escaped_like_impl(a.istartswith, b, escape, autoescape)
 
@@ -1966,7 +1966,7 @@ notendswith_op = not_endswith_op
 @comparison_op
 @_operator_fn
 def iendswith_op(
-        a: Any, b: Any, escape: Optional[str] = None, autoescape: bool = False
+    a: Any, b: Any, escape: Optional[str] = None, autoescape: bool = False
 ) -> Any:
     return _escaped_like_impl(a.iendswith, b, escape, autoescape)
 
@@ -1974,7 +1974,7 @@ def iendswith_op(
 @comparison_op
 @_operator_fn
 def not_iendswith_op(
-        a: Any, b: Any, escape: Optional[str] = None, autoescape: bool = False
+    a: Any, b: Any, escape: Optional[str] = None, autoescape: bool = False
 ) -> Any:
     return ~_escaped_like_impl(a.iendswith, b, escape, autoescape)
 
@@ -2002,7 +2002,7 @@ notcontains_op = not_contains_op
 @comparison_op
 @_operator_fn
 def icontains_op(
-        a: Any, b: Any, escape: Optional[str] = None, autoescape: bool = False
+    a: Any, b: Any, escape: Optional[str] = None, autoescape: bool = False
 ) -> Any:
     return _escaped_like_impl(a.icontains, b, escape, autoescape)
 
@@ -2010,7 +2010,7 @@ def icontains_op(
 @comparison_op
 @_operator_fn
 def not_icontains_op(
-        a: Any, b: Any, escape: Optional[str] = None, autoescape: bool = False
+    a: Any, b: Any, escape: Optional[str] = None, autoescape: bool = False
 ) -> Any:
     return ~_escaped_like_impl(a.icontains, b, escape, autoescape)
 
index de2004225ac3b8432e9b04495109513cf5425a36..9640e25a4d75f0fb3315faadcc11b47c85f3e2f4 100644 (file)
@@ -3917,7 +3917,8 @@ class ComposedLikeOperatorsTest(fixtures.TestBase, testing.AssertsCompiledSQL):
     def test_iendswith_text(self):
         self.assert_compile(
             column("x").iendswith(text("y")),
-            "lower(x) LIKE '%' || lower(y)", checkparams={}
+            "lower(x) LIKE '%' || lower(y)",
+            checkparams={},
         )
 
     def test_iendswith_mysql(self):