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

CI job trips on Apache Superset 2.x: AttributeError: module 'flask.json' has no attribute 'JSONEncoder' #313

Closed
amotl opened this issue Feb 21, 2024 · 5 comments · Fixed by #335

Comments

@amotl
Copy link
Member

amotl commented Feb 21, 2024

Problem

Invoking superset db upgrade fails.

-- https://github.com/crate/cratedb-examples/actions/runs/8005637022/job/21865556761#step:7:290

History

It failed for the first time on Tue, 20 Feb 2024 03:06:45 GMT. Before, it worked well, and nothing was changed on our ends.

-- https://github.com/crate/cratedb-examples/actions/workflows/application-apache-superset.yml

@amotl
Copy link
Member Author

amotl commented Feb 21, 2024

Root cause

The traceback is:

Traceback (most recent call last):
  File "/path/to/bin/superset", line 5, in <module>
    from superset.cli.main import superset
  File "/path/to/lib/python3.11/site-packages/superset/__init__.py", line 21, in <module>
    from superset.app import create_app
  File "/path/to/lib/python3.11/site-packages/superset/app.py", line 23, in <module>
    from superset.initialization import SupersetAppInitializer
  File "/path/to/lib/python3.11/site-packages/superset/initialization/__init__.py", line 27, in <module>
    from flask_appbuilder import expose, IndexView
  File "/path/to/lib/python3.11/site-packages/flask_appbuilder/__init__.py", line 5, in <module>
    from .api import ModelRestApi  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/lib/python3.11/site-packages/flask_appbuilder/api/__init__.py", line 38, in <module>
    from ..baseviews import AbstractViewApi
  File "/path/to/lib/python3.11/site-packages/flask_appbuilder/baseviews.py", line 22, in <module>
    from .forms import GeneralModelConverter
  File "/path/to/lib/python3.11/site-packages/flask_appbuilder/forms.py", line 3, in <module>
    from flask_wtf import FlaskForm
  File "/path/to/lib/python3.11/site-packages/flask_wtf/__init__.py", line 4, in <module>
    from .recaptcha import Recaptcha
  File "/path/to/lib/python3.11/site-packages/flask_wtf/recaptcha/__init__.py", line 1, in <module>
    from .fields import RecaptchaField
  File "/path/to/lib/python3.11/site-packages/flask_wtf/recaptcha/fields.py", line 3, in <module>
    from . import widgets
  File "/path/to/lib/python3.11/site-packages/flask_wtf/recaptcha/widgets.py", line 6, in <module>
    JSONEncoder = json.JSONEncoder
                  ^^^^^^^^^^^^^^^^
AttributeError: module 'flask.json' has no attribute 'JSONEncoder'

References

@amotl
Copy link
Member Author

amotl commented Feb 21, 2024

Downgrading to Flask 2.2, using pip install 'flask<2.3', as suggested, apparently resolves the problem, but then trips with a totally different error:

ERROR [flask_migrate] Error: Can't locate revision identified by 'b7851ee5522f'

@amotl amotl changed the title Apache Superset 2.x: Trips CI starting Tue, 20 Feb 2024 03:06:45 GMT CI job trips on Apache Superset 2.x: AttributeError: module 'flask.json' has no attribute 'JSONEncoder' Feb 22, 2024
@amotl
Copy link
Member Author

amotl commented Feb 22, 2024

I can't discover the root cause, so I've reported it to upstream.

@amotl
Copy link
Member Author

amotl commented Feb 26, 2024

The upstream issue has been converted into a discussion, because Apache Superset 2.x is not supported any longer. Thanks, @michael-s-molina.

/cc @proddata

@amotl
Copy link
Member Author

amotl commented Feb 27, 2024

GH-335 will remove testing of Apache Superset 2.x on CI.

@amotl amotl linked a pull request Feb 27, 2024 that will close this issue
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.

1 participant