Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Superset 3.0 pypi package installs wrong version of wtforms #25622

Closed
igorcalabria opened this issue Oct 12, 2023 · 2 comments · May be fixed by #25643
Closed

Superset 3.0 pypi package installs wrong version of wtforms #25622

igorcalabria opened this issue Oct 12, 2023 · 2 comments · May be fixed by #25643

Comments

@igorcalabria
Copy link

When installing superset with pip, it seems that a wrong version of wtforms is used. Which results in errors like this in some pages (List users, roles, and activity for example)

2023-10-12 11:51:31,302:ERROR:superset.views.base:not enough values to unpack (expected 4, got 3)
Traceback (most recent call last):
  File "/venv/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/venv/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/venv/lib/python3.9/site-packages/flask_appbuilder/security/decorators.py", line 137, in wraps
    return f(self, *args, **kwargs)
  File "/venv/lib/python3.9/site-packages/flask_appbuilder/views.py", line 555, in list
    return self.render_template(
  File "/venv/lib/python3.9/site-packages/flask_appbuilder/baseviews.py", line 343, in render_template
    return render_template(
  File "/venv/lib/python3.9/site-packages/flask/templating.py", line 151, in render_template
    return _render(app, template, context)
  File "/venv/lib/python3.9/site-packages/flask/templating.py", line 132, in _render
    rv = template.render(context)
  File "/venv/lib/python3.9/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/venv/lib/python3.9/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/venv/lib/python3.9/site-packages/superset/templates/appbuilder/general/model/list.html", line 20, in top-level template code
    {% import 'appbuilder/general/lib.html' as lib %}
  File "/venv/lib/python3.9/site-packages/flask_appbuilder/templates/appbuilder/base.html", line 1, in top-level template code
    {% extends base_template %}
  File "/venv/lib/python3.9/site-packages/superset/templates/superset/base.html", line 20, in top-level template code
    {% from 'superset/partials/asset_bundle.html' import css_bundle, js_bundle with context %}
  File "/venv/lib/python3.9/site-packages/superset/templates/appbuilder/baselayout.html", line 20, in top-level template code
    {% import 'appbuilder/baselib.html' as baselib %}
  File "/venv/lib/python3.9/site-packages/flask_appbuilder/templates/appbuilder/init.html", line 42, in top-level template code
    {% block body %}
  File "/venv/lib/python3.9/site-packages/superset/templates/appbuilder/baselayout.html", line 37, in block 'body'
    {% block content %}
  File "/venv/lib/python3.9/site-packages/superset/templates/appbuilder/general/model/list.html", line 26, in block 'content'
    {% block list_search scoped %}
  File "/venv/lib/python3.9/site-packages/superset/templates/appbuilder/general/model/list.html", line 27, in block 'list_search'
    {{ widgets.get('search')()|safe }}
  File "/venv/lib/python3.9/site-packages/flask_appbuilder/widgets.py", line 115, in __call__
    form_fields[col] = self.template_args["form"][col]()
  File "/venv/lib/python3.9/site-packages/wtforms/fields/core.py", line 176, in __call__
    return self.meta.render_field(self, kwargs)
  File "/venv/lib/python3.9/site-packages/wtforms/meta.py", line 64, in render_field
    return field.widget(field, **render_kw)
  File "/venv/lib/python3.9/site-packages/flask_appbuilder/fieldwidgets.py", line 181, in __call__
    return super(Select2ManyWidget, self).__call__(field, **kwargs)
  File "/venv/lib/python3.9/site-packages/wtforms/widgets/core.py", line 365, in __call__
    for val, label, selected, render_kw in field.iter_choices():
ValueError: not enough values to unpack (expected 4, got 3)

How to reproduce the bug

  1. Install superset on a fresh virtual environment with pip install apache-superset==3.0.0
  2. Run the usual setup and init
  3. Navigate to "List users", "List roles" or "Action Log"

Expected results

I've expected superset package from pypi to require the correct versions for its dependencies.

Additional context

setup.py requires "wtforms>=2.3.3, <4" but it looks like superset 3.0 is not compatible with wtforms=3.1.0 which was the version installed on this case. To fix this, I just installed version 2.3.3 manually

pip uninstall wtforms
pip install wtforms==2.3.3
@leandroneckel
Copy link

Adding

RUN pip uninstall wtforms -y
RUN pip install wtforms==2.3.3

to my dockerfile solved my issue here. Thanks!

@sfirke
Copy link
Member

sfirke commented Nov 30, 2023

Closing as a duplicate of #25631. Please see the latest comment there, this should be fixed in Superset 3.0.2.

@sfirke sfirke closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants