From: Dzmitar <17720985+dzmitar@users.noreply.github.com> Date: Wed, 4 Jan 2023 12:42:31 +0000 (+0100) Subject: Fix type annotations X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c5c5bfd4138f22fd26b12e5ccd3c9c08e1b7890;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Fix type annotations --- diff --git a/lib/sqlalchemy/sql/_selectable_constructors.py b/lib/sqlalchemy/sql/_selectable_constructors.py index a0dbb5fb59..1e52a13f28 100644 --- a/lib/sqlalchemy/sql/_selectable_constructors.py +++ b/lib/sqlalchemy/sql/_selectable_constructors.py @@ -89,7 +89,7 @@ def alias( :meth:`_expression.Join.alias` for details. """ - return Alias._factory(selectable, name=name, flat=flat) + return Alias._factory(selectable, name=name, flat=flat) # type: ignore def cte( @@ -293,7 +293,7 @@ def lateral( :ref:`tutorial_lateral_correlation` - overview of usage. """ - return Lateral._factory(selectable, name=name) + return Lateral._factory(selectable, name=name) # type: ignore def outerjoin( @@ -568,7 +568,7 @@ def tablesample( REPEATABLE sub-clause is also rendered. """ - return TableSample._factory(selectable, sampling, name=name, seed=seed) + return TableSample._factory(selectable, sampling, name=name, seed=seed) # type: ignore # noqa E501 def union( diff --git a/lib/sqlalchemy/sql/functions.py b/lib/sqlalchemy/sql/functions.py index 742f211c9e..1e5f3c33d0 100644 --- a/lib/sqlalchemy/sql/functions.py +++ b/lib/sqlalchemy/sql/functions.py @@ -626,7 +626,7 @@ class FunctionElement(Executable, ColumnElement[_T], FromClause, Generative): """ - return TableValuedAlias._construct( + return TableValuedAlias._construct( # type: ignore[attr-defined] self, name, table_value_type=self.type, diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py index bef4372ecb..b7078a3f21 100644 --- a/lib/sqlalchemy/sql/util.py +++ b/lib/sqlalchemy/sql/util.py @@ -1164,7 +1164,7 @@ class ClauseAdapter(visitors.ReplacingExternalTraversal): return None return self.selectable # type: ignore elif isinstance(col, Alias) and isinstance( - col.element, TableClause + col.element, TableClause # type: ignore[attr-defined] ): # we are a SELECT statement and not derived from an alias of a # table (which nonetheless may be a table our SELECT derives