From: Matias Martinez Rebori Date: Wed, 7 Sep 2022 16:21:49 +0000 (-0400) Subject: run black code formatter X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8496%2Fhead;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git run black code formatter --- diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index d11e5a0406..bc759da27b 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -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): diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py index 4f1d097c66..49cf05f8de 100644 --- a/lib/sqlalchemy/sql/operators.py +++ b/lib/sqlalchemy/sql/operators.py @@ -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) diff --git a/test/sql/test_operators.py b/test/sql/test_operators.py index de2004225a..9640e25a4d 100644 --- a/test/sql/test_operators.py +++ b/test/sql/test_operators.py @@ -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):