def char_length(self) -> Type[char_length]:
...
- # appease mypy which seems to not want to accept _T from
- # _ColumnExpressionArgument, as it includes non-generic types
+ # set ColumnElement[_T] as a separate overload, to appease mypy
+ # which seems to not want to accept _T from _ColumnExpressionArgument.
+ # this is even if all non-generic types are removed from it, so
+ # reasons remain unclear for why this does not work
@overload
def coalesce(
self,
col: ColumnElement[_T],
- *args: _ColumnExpressionArgument[Any],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
) -> coalesce[_T]:
...
def coalesce(
self,
col: _ColumnExpressionArgument[_T],
- *args: _ColumnExpressionArgument[Any],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
) -> coalesce[_T]:
...
+ @overload
def coalesce(
self,
- col: _ColumnExpressionArgument[_T],
- *args: _ColumnExpressionArgument[Any],
+ col: _ColumnExpressionOrLiteralArgument[_T],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
+ **kwargs: Any,
+ ) -> coalesce[_T]:
+ ...
+
+ def coalesce(
+ self,
+ col: _ColumnExpressionOrLiteralArgument[_T],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
) -> coalesce[_T]:
...
def localtimestamp(self) -> Type[localtimestamp]:
...
- # appease mypy which seems to not want to accept _T from
- # _ColumnExpressionArgument, as it includes non-generic types
+ # set ColumnElement[_T] as a separate overload, to appease mypy
+ # which seems to not want to accept _T from _ColumnExpressionArgument.
+ # this is even if all non-generic types are removed from it, so
+ # reasons remain unclear for why this does not work
@overload
def max( # noqa: A001
self,
col: ColumnElement[_T],
- *args: _ColumnExpressionArgument[Any],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
) -> max[_T]:
...
def max( # noqa: A001
self,
col: _ColumnExpressionArgument[_T],
- *args: _ColumnExpressionArgument[Any],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
) -> max[_T]:
...
+ @overload
def max( # noqa: A001
self,
- col: _ColumnExpressionArgument[_T],
- *args: _ColumnExpressionArgument[Any],
+ col: _ColumnExpressionOrLiteralArgument[_T],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
+ **kwargs: Any,
+ ) -> max[_T]:
+ ...
+
+ def max( # noqa: A001
+ self,
+ col: _ColumnExpressionOrLiteralArgument[_T],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
) -> max[_T]:
...
- # appease mypy which seems to not want to accept _T from
- # _ColumnExpressionArgument, as it includes non-generic types
+ # set ColumnElement[_T] as a separate overload, to appease mypy
+ # which seems to not want to accept _T from _ColumnExpressionArgument.
+ # this is even if all non-generic types are removed from it, so
+ # reasons remain unclear for why this does not work
@overload
def min( # noqa: A001
self,
col: ColumnElement[_T],
- *args: _ColumnExpressionArgument[Any],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
) -> min[_T]:
...
def min( # noqa: A001
self,
col: _ColumnExpressionArgument[_T],
- *args: _ColumnExpressionArgument[Any],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
) -> min[_T]:
...
+ @overload
def min( # noqa: A001
self,
- col: _ColumnExpressionArgument[_T],
- *args: _ColumnExpressionArgument[Any],
+ col: _ColumnExpressionOrLiteralArgument[_T],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
+ **kwargs: Any,
+ ) -> min[_T]:
+ ...
+
+ def min( # noqa: A001
+ self,
+ col: _ColumnExpressionOrLiteralArgument[_T],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
) -> min[_T]:
...
def session_user(self) -> Type[session_user]:
...
- # appease mypy which seems to not want to accept _T from
- # _ColumnExpressionArgument, as it includes non-generic types
+ # set ColumnElement[_T] as a separate overload, to appease mypy
+ # which seems to not want to accept _T from _ColumnExpressionArgument.
+ # this is even if all non-generic types are removed from it, so
+ # reasons remain unclear for why this does not work
@overload
def sum( # noqa: A001
self,
col: ColumnElement[_T],
- *args: _ColumnExpressionArgument[Any],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
) -> sum[_T]:
...
def sum( # noqa: A001
self,
col: _ColumnExpressionArgument[_T],
- *args: _ColumnExpressionArgument[Any],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
) -> sum[_T]:
...
+ @overload
def sum( # noqa: A001
self,
- col: _ColumnExpressionArgument[_T],
- *args: _ColumnExpressionArgument[Any],
+ col: _ColumnExpressionOrLiteralArgument[_T],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
+ **kwargs: Any,
+ ) -> sum[_T]:
+ ...
+
+ def sum( # noqa: A001
+ self,
+ col: _ColumnExpressionOrLiteralArgument[_T],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
) -> sum[_T]:
...
inherit_cache = True
- # appease mypy which seems to not want to accept _T from
- # _ColumnExpressionArgument, as it includes non-generic types
+ # set ColumnElement[_T] as a separate overload, to appease mypy which seems
+ # to not want to accept _T from _ColumnExpressionArgument. this is even if
+ # all non-generic types are removed from it, so reasons remain unclear for
+ # why this does not work
@overload
def __init__(
self,
col: ColumnElement[_T],
- *args: _ColumnExpressionArgument[Any],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
):
...
def __init__(
self,
col: _ColumnExpressionArgument[_T],
- *args: _ColumnExpressionArgument[Any],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
):
...
- def __init__(self, *args: _ColumnExpressionArgument[Any], **kwargs: Any):
+ @overload
+ def __init__(
+ self,
+ col: _ColumnExpressionOrLiteralArgument[_T],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
+ **kwargs: Any,
+ ):
+ ...
+
+ def __init__(
+ self, *args: _ColumnExpressionOrLiteralArgument[Any], **kwargs: Any
+ ):
fn_args: Sequence[ColumnElement[Any]] = [
coercions.expect(
roles.ExpressionElementRole,
textwrap.indent(
f"""
-# appease mypy which seems to not want to accept _T from
-# _ColumnExpressionArgument, as it includes non-generic types
+# set ColumnElement[_T] as a separate overload, to appease mypy
+# which seems to not want to accept _T from _ColumnExpressionArgument.
+# this is even if all non-generic types are removed from it, so
+# reasons remain unclear for why this does not work
@overload
def {key}( {' # noqa: A001' if is_reserved_word else ''}
self,
col: ColumnElement[_T],
- *args: _ColumnExpressionArgument[Any],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
) -> {fn_class.__name__}[_T]:
...
def {key}( {' # noqa: A001' if is_reserved_word else ''}
self,
col: _ColumnExpressionArgument[_T],
- *args: _ColumnExpressionArgument[Any],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
) -> {fn_class.__name__}[_T]:
...
+
+@overload
def {key}( {' # noqa: A001' if is_reserved_word else ''}
self,
- col: _ColumnExpressionArgument[_T],
- *args: _ColumnExpressionArgument[Any],
+ col: _ColumnExpressionOrLiteralArgument[_T],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
+ **kwargs: Any,
+) -> {fn_class.__name__}[_T]:
+ ...
+
+
+def {key}( {' # noqa: A001' if is_reserved_word else ''}
+ self,
+ col: _ColumnExpressionOrLiteralArgument[_T],
+ *args: _ColumnExpressionOrLiteralArgument[Any],
**kwargs: Any,
) -> {fn_class.__name__}[_T]:
...