From: Daniƫl <93520871+Flaab123@users.noreply.github.com> Date: Tue, 16 Dec 2025 13:27:05 +0000 (-0500) Subject: Fix typing of `partial_reordering` X-Git-Tag: rel_1_18_0~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=feada2888143efad43c1581811f33dc8a2944a58;p=thirdparty%2Fsqlalchemy%2Falembic.git Fix typing of `partial_reordering` The typing of the `partial_reordering` argument of `batch_alter_table` is not correct. As stated in the documentation and docstring, the `batch_alter_table()` function expects a list of tuples for the `partial_reordering` argument. The current typing suggests the user to insert a tuple containing Any into the argument, which doesn't align with the docstring. This pull request is: - [ x] A documentation / typographical 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: #` 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: #` in the commit message - please include tests. **Have a nice day!** Closes: #1764 Pull-request: https://github.com/sqlalchemy/alembic/pull/1764 Pull-request-sha: f0a0c1a913b93a2c71881e69be83a7888e21bc5e Change-Id: I1f442df0674e85361234a97aed1d79f58d30214f --- diff --git a/alembic/op.pyi b/alembic/op.pyi index cb4953c1..6da53871 100644 --- a/alembic/op.pyi +++ b/alembic/op.pyi @@ -256,7 +256,7 @@ def batch_alter_table( table_name: str, schema: Optional[str] = None, recreate: Literal["auto", "always", "never"] = "auto", - partial_reordering: Optional[Tuple[Any, ...]] = None, + partial_reordering: Optional[list[tuple[str, ...]]] = None, copy_from: Optional[Table] = None, table_args: Tuple[Any, ...] = (), table_kwargs: Mapping[str, Any] = immutabledict({}), diff --git a/alembic/operations/base.py b/alembic/operations/base.py index bea7f9dc..5ca38b1f 100644 --- a/alembic/operations/base.py +++ b/alembic/operations/base.py @@ -248,7 +248,7 @@ class AbstractOperations(util.ModuleClsProxy): table_name: str, schema: Optional[str] = None, recreate: Literal["auto", "always", "never"] = "auto", - partial_reordering: Optional[Tuple[Any, ...]] = None, + partial_reordering: Optional[list[tuple[str, ...]]] = None, copy_from: Optional[Table] = None, table_args: Tuple[Any, ...] = (), table_kwargs: Mapping[str, Any] = util.immutabledict(),