]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
Fix type annotation in `op.create_table_comment`
authorColin Adams <adamscolinc@gmail.com>
Thu, 13 Apr 2023 19:24:41 +0000 (15:24 -0400)
committerFederico Caselli <cfederico87@gmail.com>
Thu, 13 Apr 2023 19:32:39 +0000 (21:32 +0200)
### 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

alembic/op.pyi
alembic/operations/ops.py

index bb091c42a5e242b3c79a7b0b2c0e2f637e0fc73a..dc94113996666acf42960bca18ef472f9fef05bf 100644 (file)
@@ -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.
index 789fb58a68d93fc63ca556b30bc30c77d5952fba..b3ef5bb6a09bb29da231ddb18b1d6b9343c82110 100644 (file)
@@ -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.