dpgaspar / Flask-AppBuilder

Simple and rapid application development framework, built on top of Flask. includes detailed security, auto CRUD generation for your models, google charts and much more. Demo (login with guest/welcome) - http://flaskappbuilder.pythonanywhere.com/
BSD 3-Clause "New" or "Revised" License
4.63k stars 1.35k forks source link

Add support for marshmallow-sqlalchemy 1.0.0 #2194

Open AlphaJack opened 6 months ago

AlphaJack commented 6 months ago

Environment

pip-freeze:

Flask==2.3.3
Flask-AppBuilder==4.3.11
flask-babel==3.1.0
Flask-Caching==2.0.2
Flask-Compress==1.14
Flask-JWT-Extended==4.5.3
Flask-Limiter==3.5.0
Flask-Login==0.6.3
Flask-Migrate==4.0.5
Flask-OpenID==1.3.0
Flask-Session==0.6.0
Flask-Sockets==0.2.1
Flask-SQLAlchemy==2.5.1
flask-talisman==1.1.0
Flask-WTF==1.1.1
marshmallow==3.20.0
marshmallow-sqlalchemy==1.0.0

Describe the expected results

I am getting a TypeError during the initialization of an app that loads Flask-AppBuilder (see below).

I have tried both marshmallow-sqlalchemy 1.0.0, 0.30 and 0.26, but all of them returns the same results.

I am not sure the error involves Flask-AppBuilder directly, but I wanted to check why there is no support for the latest version of marshmallow-sqlalchemy.

Describe the actual results

When launching the app, I get

Traceback (most recent call last):
  File "/usr/bin/superset", line 5, in <module>
    from superset.cli.main import superset
  File "/usr/lib/python3.11/site-packages/superset/__init__.py", line 21, in <module>
    from superset.app import create_app
  File "/usr/lib/python3.11/site-packages/superset/app.py", line 24, in <module>
    from superset.initialization import SupersetAppInitializer
  File "/usr/lib/python3.11/site-packages/superset/initialization/__init__.py", line 28, in <module>
    from flask_appbuilder import expose, IndexView
  File "/usr/lib/python3.11/site-packages/flask_appbuilder/__init__.py", line 5, in <module>
    from .api import ModelRestApi  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/flask_appbuilder/api/__init__.py", line 29, in <module>
    from marshmallow_sqlalchemy.fields import Related, RelatedList
  File "/usr/lib/python3.11/site-packages/marshmallow_sqlalchemy/__init__.py", line 1, in <module>
    from .schema import (
  File "/usr/lib/python3.11/site-packages/marshmallow_sqlalchemy/schema.py", line 143, in <module>
    class SQLAlchemySchema(
  File "/usr/lib/python3.11/site-packages/marshmallow/schema.py", line 116, in __new__
    klass._declared_fields = mcs.get_declared_fields(
                             ^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: SQLAlchemySchemaMeta.get_declared_fields() missing 1 required positional argument: 'dict_cls'

Steps to reproduce

on Arch Linux/Manjaro: yay -S superset && superset --help