summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Adams <adamscolinc@gmail.com>2023-04-13 15:24:41 -0400
committerFederico Caselli <cfederico87@gmail.com>2023-04-13 21:32:39 +0200
commit6d5ac4fdf0066fb073636233d8cd334f8f02b5a3 (patch)
treee0ee6eb915504d68fff461183a76e363ceecd0ad
parentd3f869bb3159d18669fb6f00cbe514307118eea7 (diff)
downloadalembic-6d5ac4fdf0066fb073636233d8cd334f8f02b5a3.tar.gz
Fix type annotation in `op.create_table_comment`
### Description The `existing_comment` parameter had type `None`, but it should be `Optional[str]`. Fixes #903 ### Checklist 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: #1115 Pull-request: https://github.com/sqlalchemy/alembic/pull/1115 Pull-request-sha: 973ca93b199dccf4474db650bcfee797b2bf7c51 Change-Id: Ic4a25e320fe3e4578e3df9aea689d760844c055e
-rw-r--r--alembic/op.pyi2
-rw-r--r--alembic/operations/ops.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/alembic/op.pyi b/alembic/op.pyi
index bb091c4..dc94113 100644
--- a/alembic/op.pyi
+++ b/alembic/op.pyi
@@ -752,7 +752,7 @@ def create_table(
def create_table_comment(
table_name: str,
comment: Optional[str],
- existing_comment: None = None,
+ existing_comment: Optional[str] = None,
schema: Optional[str] = None,
) -> Optional[Table]:
"""Emit a COMMENT ON operation to set the comment for a table.
diff --git a/alembic/operations/ops.py b/alembic/operations/ops.py
index 789fb58..b3ef5bb 100644
--- a/alembic/operations/ops.py
+++ b/alembic/operations/ops.py
@@ -1422,7 +1422,7 @@ class CreateTableCommentOp(AlterTableOp):
operations: Operations,
table_name: str,
comment: Optional[str],
- existing_comment: None = None,
+ existing_comment: Optional[str] = None,
schema: Optional[str] = None,
) -> Optional[Table]:
"""Emit a COMMENT ON operation to set the comment for a table.