Improve typing to allow `'*'` and 1 in the count function.
Fixes: #11316
Change-Id: Iaafdb779b6baa70504154099f0b9554c612a9ffa
/db_idents.txt
.DS_Store
.vs
+/scratch
# cython complied files
/lib/**/*.c
"Decimal",
)
+_StarOrOne = Literal["*", 1]
+
_MAYBE_ENTITY = TypeVar(
"_MAYBE_ENTITY",
roles.ColumnsClauseRole,
- Literal["*", 1],
+ _StarOrOne,
Type[Any],
Inspectable[_HasClauseElement[Any]],
_HasClauseElement[Any],
roles.TypedColumnsClauseRole[_T],
roles.ColumnsClauseRole,
"SQLCoreOperations[_T]",
- Literal["*", 1],
+ _StarOrOne,
Type[_T],
Inspectable[_HasClauseElement[_T]],
_HasClauseElement[_T],
from ._typing import _ColumnExpressionArgument
from ._typing import _ColumnExpressionOrLiteralArgument
from ._typing import _ColumnExpressionOrStrLabelArgument
+ from ._typing import _StarOrOne
from ._typing import _TypeEngineArgument
from .base import _EntityNamespace
from .elements import ClauseElement
def __init__(
self,
- expression: Optional[_ColumnExpressionArgument[Any]] = None,
+ expression: Union[
+ _ColumnExpressionArgument[Any], _StarOrOne, None
+ ] = None,
**kwargs: Any,
):
if expression is None:
from sqlalchemy import column
from sqlalchemy import func
from sqlalchemy import Integer
+from sqlalchemy import Select
from sqlalchemy import select
from sqlalchemy import Sequence
from sqlalchemy import String
reveal_type(stmt23)
# END GENERATED FUNCTION TYPING TESTS
+
+stmt_count: Select[int, int, int] = select(
+ func.count(), func.count("*"), func.count(1)
+)