summaryrefslogtreecommitdiff
path: root/alembic/runtime
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2023-05-16 21:52:02 +0200
committerFederico Caselli <cfederico87@gmail.com>2023-05-16 21:52:02 +0200
commit6ad07e26f8b8fc3da931ea572547bb6f2643e088 (patch)
treeeac3a8dfc4e35ab72a1533f6e7cee05c6458b55b /alembic/runtime
parent95adff69ec5b821235489e4fafdab358a18f323f (diff)
downloadalembic-6ad07e26f8b8fc3da931ea572547bb6f2643e088.tar.gz
Define type for generic classes
Fixed typing use of :class:`~sqlalchemy.schema.Column` and other generic SQLAlchemy classes. Fixes: #1246 Change-Id: I5ee80395d626894a52e3395c9986213289576355
Diffstat (limited to 'alembic/runtime')
-rw-r--r--alembic/runtime/environment.py4
-rw-r--r--alembic/runtime/migration.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/alembic/runtime/environment.py b/alembic/runtime/environment.py
index 3087377..acd5cd1 100644
--- a/alembic/runtime/environment.py
+++ b/alembic/runtime/environment.py
@@ -84,8 +84,8 @@ OnVersionApplyFn = Callable[
CompareServerDefault = Callable[
[
MigrationContext,
- Column,
- Column,
+ "Column[Any]",
+ "Column[Any]",
Optional[str],
Optional[FetchedValue],
Optional[str],
diff --git a/alembic/runtime/migration.py b/alembic/runtime/migration.py
index 8baeaf0..1715e8a 100644
--- a/alembic/runtime/migration.py
+++ b/alembic/runtime/migration.py
@@ -708,7 +708,7 @@ class MigrationContext:
return None
def _compare_type(
- self, inspector_column: Column, metadata_column: Column
+ self, inspector_column: Column[Any], metadata_column: Column
) -> bool:
if self._user_compare_type is False:
return False
@@ -728,8 +728,8 @@ class MigrationContext:
def _compare_server_default(
self,
- inspector_column: Column,
- metadata_column: Column,
+ inspector_column: Column[Any],
+ metadata_column: Column[Any],
rendered_metadata_default: Optional[str],
rendered_column_default: Optional[str],
) -> bool: