@@ -48,7 +48,9 @@ class _FSAModel(Model):
4848    metadata : sa .MetaData 
4949
5050
51- def  _get_2x_declarative_bases (model_class : t .Type [_FSA_MC ]) ->  list [t .Type ]:
51+ def  _get_2x_declarative_bases (
52+     model_class : t .Type [_FSA_MC ],
53+ ) ->  list [t .Type [t .Union [sa_orm .DeclarativeBase , sa_orm .DeclarativeBaseNoMeta ]]]:
5254    return  [
5355        b 
5456        for  b  in  model_class .__bases__ 
@@ -81,10 +83,6 @@ class SQLAlchemy:
8183    :param app: Call :meth:`init_app` on this Flask application now. 
8284    :param metadata: Use this as the default :class:`sqlalchemy.schema.MetaData`. Useful 
8385        for setting a naming convention. 
84-         .. deprecated:: 3.1.0 
85-             This parameter can still be used in conjunction with SQLAlchemy 1.x classes, 
86-             but is ignored when using SQLAlchemy 2.x style of declarative classes. 
87-             Instead, specify metadata on your Base class. 
8886    :param session_options: Arguments used by :attr:`session` to create each session 
8987        instance. A ``scopefunc`` key will be passed to the scoped session, not the 
9088        session instance. See :class:`sqlalchemy.orm.sessionmaker` for a list of 
@@ -101,8 +99,16 @@ class SQLAlchemy:
10199        ``flask shell``. 
102100
103101    .. versionchanged:: 3.1.0 
104-         Added the ``disable_autonaming`` parameter and changed ``model_class`` parameter 
105-         to accept a SQLAlchemy 2.0-style declarative base subclass. 
102+         The ``metadata`` parameter can still be used with SQLAlchemy 1.x classes, 
103+         but is ignored when using SQLAlchemy 2.x style of declarative classes. 
104+         Instead, specify metadata on your Base class. 
105+ 
106+     .. versionchanged:: 3.1.0 
107+         Added the ``disable_autonaming`` parameter. 
108+ 
109+     .. versionchanged:: 3.1.0 
110+         Changed ``model_class`` parameter to accepta SQLAlchemy 2.x 
111+         declarative base subclass. 
106112
107113    .. versionchanged:: 3.0 
108114        An active Flask application context is always required to access ``session`` and 
@@ -534,7 +540,10 @@ def _make_declarative_base(
534540                " Got: {}" .format (model_class .__bases__ )
535541            )
536542        elif  len (declarative_bases ) ==  1 :
537-             body  =  {"__fsa__" : self , "metadata" : model_class .metadata }
543+             body  =  {
544+                 "__fsa__" : self ,
545+                 "metadata" : model_class .metadata ,  # type: ignore[attr-defined] 
546+             }
538547            mixin_classes  =  [BindMixin , NameMixin , Model ]
539548            if  disable_autonaming :
540549                mixin_classes .remove (NameMixin )
0 commit comments