Skip to content

Make Superset compatible with marshmallow>=4.0.0 #33162

Closed

Description

@MattBodey

Bug description

On a fresh install of superset, since marshmallow 4.0.0 released https://pypi.org/project/marshmallow/, superset fails to init due to an error validating parameters

It is possible to work around this by manually installing marshmallow at 3.26.1

pip3 install marshmallow==3.26.1

It looks like the version is being set in requirements/development.txt, so I'm unsure as to where the version update is occurring

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Not applicable

Additional context

File "/home/ec2-user/.local/lib/python3.9/site-packages/superset/charts/schemas.py", line 621, in ChartDataProphetOptionsSchema
periods = fields.Integer(
File "/home/ec2-user/.local/lib/python3.9/site-packages/marshmallow/fields.py", line 977, in init
super().init(as_string=as_string, **kwargs)
File "/home/ec2-user/.local/lib/python3.9/site-packages/marshmallow/fields.py", line 924, in init
super().init(**kwargs)
TypeError: init() got an unexpected keyword argument 'min'

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Activity

  1. dosubot commented on Apr 17, 2025

    @dosubot

    Hello @MattBodey! I'm Dosu, a bot here to help you with bugs, answer your questions, and guide you on your journey to becoming a contributor. I'm ready to assist while you wait for a human maintainer. Let’s tackle this together!

    The issue you're encountering is due to a compatibility problem between Superset and Marshmallow 4.0.0. Specifically, the fields.Integer class in Marshmallow 4.0.0 no longer supports the min keyword argument, which is causing the error during Superset's initialization.

    To resolve this issue, you can downgrade Marshmallow to version 3.26.1, where the min keyword argument is still supported. You can do this by running the following command:

    pip3 install marshmallow==3.26.1

    This should allow Superset to initialize without errors. It seems that the version of Marshmallow is specified in requirements/development.txt, but there might be an override or update happening elsewhere in the setup process. You may want to check other configuration files or scripts that could be specifying a different version of Marshmallow.

    To continue talking to Dosu, mention @dosu.


    Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

  2. rusackas commented on Apr 17, 2025

    @rusackas
    Member

    Is there somewhere we need to pin the dependency? It looks like Superset already installs 3.26.1. I'm not sure about the details of the failure, but I know we also use marshmallow-sqlalchemy which doesn't seem to support marshmallow 4.0 yet if I'm understanding correctly.

  3. ColinMaudry commented on Apr 18, 2025

    @ColinMaudry

    I followed the PyPi install instructions, and running pip install marshmallow==3.26.1 just before superset db upgrade did the trick.

  4. amotl commented on Apr 19, 2025

    @amotl
    Contributor

    Hi there,

    we are running a little integration test suite against Apache Superset and CrateDB, in order to validate both work together well. Two days ago, CI apparently started tripping on it.

    TypeError: Field.__init__() got an unexpected keyword argument 'minLength'

    Do you think we need to adjust a few details, or is it just about marshmallow-4.0.0, which has been released two days ago, as suggested above?

    With kind regards,
    Andreas.

    References

  5. ColinMaudry commented on Apr 19, 2025

    @ColinMaudry

    @amotl I guess either

    • superset stop using minLength and generally adapts to Marshallow v4
    • or superset ensures Marshmallow v3.26.1 is pinned all the way
    • or Marshmallow readds minLength and others

    In the meantime we must force Marshmallow version. How? Depends on how you install superset.

  6. amotl commented on Apr 20, 2025

    @amotl
    Contributor

    Hi. Thank you very much.

    In the meantime we must force Marshmallow version. How? Depends on how you install superset.

    I don't completely understand this, yet. Isn't it possible to just add a corresponding version pinning constraint to Superset's main dependencies to handle the situation well, until Superset will be compatible with Marshmallow 4?

  7. ColinMaudry commented on Apr 20, 2025

    @ColinMaudry

    Marshmallow is already pinned to the right version in development.txt, via marshmallow-sqlalchemy module requirements, but somehow v4.0.0 gets installed in the end.

  8. ColinMaudry commented on Apr 20, 2025

    @ColinMaudry

    Depends on how you install Superset.

    If you install it via pip install superset, Kubernetes or download the docker image, you won't force Marshmallow version the same way. I'm not fluent in Docker, even less in Kubernetes, so I went the PyPi way to fix it.

  9. amotl commented on Apr 21, 2025

    @amotl
    Contributor

    Hi Colin, thanks for showing the right dependency pinning in development.txt. The same, even more important, should also be conducted for the runtime dependencies, right? Otherwise, it will leave the average user stranded like outlined in this thread.

  10. amotl commented on Apr 23, 2025

    @amotl
    Contributor

    It looks like the dependency of Marshmallow is also pinned per base.txt 1. Do you have an idea why it isn't used at runtime?

    Footnotes

    1. https://github.com/apache/superset/blob/4.1.2/requirements/base.txt#L200 ↩

  11. amotl commented on Apr 23, 2025

    @amotl
    Contributor

    Hi again. We submitted a patch to the 4.1 branch, in order to improve the situation for Superset 4.

  12. added a commit that references this issue on Apr 25, 2025
  13. lostlunatiq commented on Apr 28, 2025

    @lostlunatiq

    Hi is this fixed? Or can I be assigned this one?

  14. amotl commented on Apr 28, 2025

    @amotl
    Contributor

    Hi. I think it's "in progress". I've just refreshed the patch GH-33216.

  15. 26 remaining items

  16. amotl commented on Jul 19, 2025

    @amotl
    Contributor

    @betodealmeida and @michael-s-molina: Can we humbly ask you to apply a variant of this patch also to the 5.0 branch?

  17. michael-s-molina commented on Jul 21, 2025

    @michael-s-molina
    Member

    @betodealmeida and @michael-s-molina: Can we humbly ask you to apply a variant of this patch also to the 5.0 branch?

    This was already cherry-picked into the 5.0 branch and should be available in the next patch. No ETA for the patch currently.

  18. amotl commented on Jul 21, 2025

    @amotl
    Contributor

    Ah, now I am seeing it. Thanks a lot!

  19. kevin-lann commented on Sep 27, 2025

    @kevin-lann
    Contributor

    Hi, I've been taking a look at this issue and was able to confirm that it still exists.

    This is the result of setting "marshmallow>=4" in pyproject.toml:

    Image

    If no one else is looking at this, me and some others would like to take a stab.

  20. mistercrunch commented on Sep 28, 2025

    @mistercrunch
    Member

    If no one else is looking at this, me and some others would like to take a stab.

    go for it! I assigned the issue to you.

  21. kevin-lann commented on Oct 11, 2025

    @kevin-lann
    Contributor

    Progress update on this issue:

    We've been able to resolve several of the initialization issues (including the minLength issue) by migrating to newer 4.0 marshmallow conventions using this migration guide . They are mainly related to marshmallow Schemas using outdated pre-4.0 conventions. There's quite a few instances of these to fix so will get back once we've covered them all.

    Additionally we might need to bump marshmallow-sqlalchemy to 1.5.0+ for better marshmallow 4.0 support, but willl confirm the first approach before resorting to this.

  22. mistercrunch commented on Oct 11, 2025

    @mistercrunch
    Member

    Thanks for working on this! let us know if you need help/support and when your PR is up for review

  23. kevin-lann commented on Nov 3, 2025

    @kevin-lann
    Contributor

    @mistercrunch Hi, the PR for this is ready for review now! #35920

  24. sloria commented on Apr 1, 2026

    @sloria

    marshmallow maintainer here. just a heads up that we're planning to EOL marshmallow v3 on April 16. I only skimmed #35920 but the marshmallow API changes there looks correct. i didn't get a chance to thoroughly review the Flask-AppBuilder shim. looks like there may already be pending work in FAB to support marshmallow 4

  25. rusackas commented on Jun 25, 2026

    @rusackas
    Member

    #39751 took us to marshmallow 4.3.0 with the compatibility work to back it, so this is done - closing. Earlier PRs just pinned <4; this one's the real fix.

  26. amotl commented on Jun 25, 2026

    @amotl
    Contributor

    Wonderful, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions