Skip to content

Commit feada28

Browse files
Flaab123zzzeek
authored andcommitted
Fix typing of partial_reordering
<!-- Provide a general summary of your proposed changes in the Title field above --> The typing of the `partial_reordering` argument of `batch_alter_table` is not correct. <!-- Describe your changes in detail --> 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. <!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once) --> 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: #<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. **Have a nice day!** Closes: #1764 Pull-request: #1764 Pull-request-sha: f0a0c1a Change-Id: I1f442df0674e85361234a97aed1d79f58d30214f
1 parent ab6f459 commit feada28

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

alembic/op.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def batch_alter_table(
256256
table_name: str,
257257
schema: Optional[str] = None,
258258
recreate: Literal["auto", "always", "never"] = "auto",
259-
partial_reordering: Optional[Tuple[Any, ...]] = None,
259+
partial_reordering: Optional[list[tuple[str, ...]]] = None,
260260
copy_from: Optional[Table] = None,
261261
table_args: Tuple[Any, ...] = (),
262262
table_kwargs: Mapping[str, Any] = immutabledict({}),

alembic/operations/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def batch_alter_table(
248248
table_name: str,
249249
schema: Optional[str] = None,
250250
recreate: Literal["auto", "always", "never"] = "auto",
251-
partial_reordering: Optional[Tuple[Any, ...]] = None,
251+
partial_reordering: Optional[list[tuple[str, ...]]] = None,
252252
copy_from: Optional[Table] = None,
253253
table_args: Tuple[Any, ...] = (),
254254
table_kwargs: Mapping[str, Any] = util.immutabledict(),

0 commit comments

Comments
 (0)