From 1bdfa18739e3d156f267953c71267feeded9543b Mon Sep 17 00:00:00 2001 From: DanCardin Date: Fri, 27 Sep 2024 15:03:22 -0400 Subject: [PATCH] fix: Correct the AutogenContext.metadata typing to include Sequence[Metadata]. --- alembic/autogenerate/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alembic/autogenerate/api.py b/alembic/autogenerate/api.py index 4c039162..811462e8 100644 --- a/alembic/autogenerate/api.py +++ b/alembic/autogenerate/api.py @@ -277,7 +277,7 @@ class AutogenContext: """Maintains configuration and state that's specific to an autogenerate operation.""" - metadata: Optional[MetaData] = None + metadata: Union[MetaData, Sequence[MetaData], None] = None """The :class:`~sqlalchemy.schema.MetaData` object representing the destination. @@ -332,7 +332,7 @@ class AutogenContext: def __init__( self, migration_context: MigrationContext, - metadata: Optional[MetaData] = None, + metadata: Union[MetaData, Sequence[MetaData], None] = None, opts: Optional[Dict[str, Any]] = None, autogenerate: bool = True, ) -> None: