diff options
author | liverpool1026 <liverpool1026.bne@gmail.com> | 2021-10-08 05:46:58 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-07 21:46:58 +0200 |
commit | 9b01e5fa7178333f2e78ee0fc1322112307b51dd (patch) | |
tree | bb32cf481da888b390150768bcc5057423820215 /alembic/operations | |
parent | 277c9b88214fe3fcb5a8aa01717e1aa63ad9b887 (diff) | |
download | alembic-9b01e5fa7178333f2e78ee0fc1322112307b51dd.tar.gz |
Fix issue 928 create_check_constraint condition argument typing fix (#929)master
* Update create_check_constraint method typing
* Pass str type down
Fixes: #928
Co-authored-by: Kevin Hwa <liverpoo1026.bne@gmail.com>
Co-authored-by: Kevin Hwa <kevin.hwa@polymathian.com>
Diffstat (limited to 'alembic/operations')
-rw-r--r-- | alembic/operations/ops.py | 4 | ||||
-rw-r--r-- | alembic/operations/schemaobj.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/alembic/operations/ops.py b/alembic/operations/ops.py index 7d69f09..99132dd 100644 --- a/alembic/operations/ops.py +++ b/alembic/operations/ops.py @@ -732,7 +732,7 @@ class CreateCheckConstraintOp(AddConstraintOp): self, constraint_name: Optional[str], table_name: str, - condition: Union["TextClause", "ColumnElement[Any]"], + condition: Union[str, "TextClause", "ColumnElement[Any]"], schema: Optional[str] = None, **kw ) -> None: @@ -778,7 +778,7 @@ class CreateCheckConstraintOp(AddConstraintOp): operations: "Operations", constraint_name: Optional[str], table_name: str, - condition: "BinaryExpression", + condition: Union[str, "BinaryExpression"], schema: Optional[str] = None, **kw ) -> Optional["Table"]: diff --git a/alembic/operations/schemaobj.py b/alembic/operations/schemaobj.py index 0d40dc7..3bff508 100644 --- a/alembic/operations/schemaobj.py +++ b/alembic/operations/schemaobj.py @@ -137,7 +137,7 @@ class SchemaObjects: self, name: Optional[str], source: str, - condition: Union["TextClause", "ColumnElement[Any]"], + condition: Union[str, "TextClause", "ColumnElement[Any]"], schema: Optional[str] = None, **kw ) -> Union["CheckConstraint"]: |