### Description
The documentation and the type annotations for `TableValueType()` clearly
state that both strings and column expression arguments are accepted
but the annotation omits `str`, which is the most common use case.
### Checklist
This pull request is:
- [x] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
must include a complete example of the issue. one line code fixes without an
issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests. one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.
Closes: #10886
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10886
Pull-request-sha:
624a97f051b378516518a30d88e7f216456d1c50
Change-Id: I2a1d2eb9b70815c33a27dd238ff2a9f11e5f5a64
from ._typing import _ByArgument
from ._typing import _ColumnExpressionArgument
from ._typing import _ColumnExpressionOrLiteralArgument
+ from ._typing import _ColumnExpressionOrStrLabelArgument
from ._typing import _TypeEngineArgument
from .base import _EntityNamespace
from .elements import ClauseElement
return ScalarFunctionColumn(self, name, type_)
def table_valued(
- self, *expr: _ColumnExpressionArgument[Any], **kw: Any
+ self, *expr: _ColumnExpressionOrStrLabelArgument[Any], **kw: Any
) -> TableValuedAlias:
r"""Return a :class:`_sql.TableValuedAlias` representation of this
:class:`_functions.FunctionElement` with table-valued expressions added.
).group_by(Foo.a)
# EXPECTED_TYPE: Select[Tuple[int, str]]
reveal_type(stmt2)
+
+
+# EXPECTED_TYPE: TableValuedAlias
+reveal_type(func.json_each().table_valued("key", "value"))
+# EXPECTED_TYPE: TableValuedAlias
+reveal_type(func.json_each().table_valued(Foo.a, Foo.b))