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

Flask-AppBuilder broken after new update - cannot import name 'SelectFieldBase' from 'wtforms.fields' #861

Closed
raimundovidaljunior opened this issue Oct 21, 2024 · 5 comments · Fixed by #862
Labels
bug Unexpected behavior

Comments

@raimundovidaljunior
Copy link

raimundovidaljunior commented Oct 21, 2024

Actual Behavior

Flask-AppBuilder is broken After removal of SelectFieldBase from the src/wtforms/fields/init.py

     from airflow.www import utils as wwwutils
  File "/home/runner/work/dataeng-airflow-dags/dataeng-airflow-dags/venv/lib/python3.9/site-packages/airflow/www/utils.py", line 28, in <module>
    from flask_appbuilder.forms import FieldConverter
  File "/home/runner/work/dataeng-airflow-dags/dataeng-airflow-dags/venv/lib/python3.9/site-packages/flask_appbuilder/__init__.py", line 5, in <module>
    from .api import ModelRestApi  # noqa: F401
  File "/home/runner/work/dataeng-airflow-dags/dataeng-airflow-dags/venv/lib/python3.9/site-packages/flask_appbuilder/api/__init__.py", line 38, in <module>
    from ..baseviews import AbstractViewApi
  File "/home/runner/work/dataeng-airflow-dags/dataeng-airflow-dags/venv/lib/python3.9/site-packages/flask_appbuilder/baseviews.py", line 22, in <module>
    from .forms import GeneralModelConverter
  File "/home/runner/work/dataeng-airflow-dags/dataeng-airflow-dags/venv/lib/python3.9/site-packages/flask_appbuilder/forms.py", line 16, in <module>
    from .fields import EnumField, QuerySelectField, QuerySelectMultipleField
  File "/home/runner/work/dataeng-airflow-dags/dataeng-airflow-dags/venv/lib/python3.9/site-packages/flask_appbuilder/fields.py", line 8, in <module>
    from wtforms.fields import Field, SelectField, SelectFieldBase
ImportError: cannot import name 'SelectFieldBase' from 'wtforms.fields' (/home/runner/work/dataeng-airflow-dags/dataeng-airflow-dags/venv/lib/python3.9/site-packages/wtforms/fields/__init__.py)

this is in consequence breaking a few airflow packages like so

from airflow.www import utils as wwwutils

this started happening today so I assume it was due to the new release, more specifically this

Expected Behavior

expected behaviour is having Flask-AppBuilder work properly

Environment

  • Python version: 3.9.12
  • wtforms version: 3.2.0
@raimundovidaljunior raimundovidaljunior changed the title Flask-AppBuilder broken after new update Flask-AppBuilder broken after new update - cannot import name 'SelectFieldBase' from 'wtforms.fields' Oct 21, 2024
@azmeuk azmeuk added the bug Unexpected behavior label Oct 21, 2024
@azmeuk
Copy link
Member

azmeuk commented Oct 21, 2024

Thank you for your report. Can you confirm that #862 solves your import issues?

@potiuk
Copy link

potiuk commented Oct 21, 2024

Just to confirm. Our CI in Airflow started to detect it as well https://github.com/apache/airflow/actions/runs/11435317651/job/31810505554#step:16:24

I am going to test the fix now.

@azmeuk
Copy link
Member

azmeuk commented Oct 21, 2024

The fix is in the 3.2.1 release.

@potiuk
Copy link

potiuk commented Oct 21, 2024

Thank you. Confirmed it solved our CI issue.

@potiuk
Copy link

potiuk commented Oct 21, 2024

Thanks for super fast reaction @azmeuk !

potiuk added a commit to potiuk/airflow that referenced this issue Oct 21, 2024
WTForms are limited to 3.2.0 because of the error in tests. We technically do not need it directly
as this is a dependency of Flask-WTF, but we need to specify it here to add the limitation
The issue to track it is https://github.com/pallets-eco/wtforms/issues/863
Note. 3.2.0 has been broken because of imports pallets-eco/wtforms#861 which
was fixed in 3.2.1, but after import was fixed, the tests started to work with 3.2.1
when the issue 863 is fixed, we should likely leave the line below and specify !=3.2.0,!=3.2.1
potiuk added a commit to apache/airflow that referenced this issue Oct 21, 2024
WTForms are limited to 3.2.0 because of the error in tests. We technically do not need it directly
as this is a dependency of Flask-WTF, but we need to specify it here to add the limitation
The issue to track it is https://github.com/pallets-eco/wtforms/issues/863
Note. 3.2.0 has been broken because of imports pallets-eco/wtforms#861 which
was fixed in 3.2.1, but after import was fixed, the tests started to work with 3.2.1
when the issue 863 is fixed, we should likely leave the line below and specify !=3.2.0,!=3.2.1
jscheffl pushed a commit to jscheffl/airflow that referenced this issue Oct 21, 2024
WTForms are limited to 3.2.0 because of the error in tests. We technically do not need it directly
as this is a dependency of Flask-WTF, but we need to specify it here to add the limitation
The issue to track it is https://github.com/pallets-eco/wtforms/issues/863
Note. 3.2.0 has been broken because of imports pallets-eco/wtforms#861 which
was fixed in 3.2.1, but after import was fixed, the tests started to work with 3.2.1
when the issue 863 is fixed, we should likely leave the line below and specify !=3.2.0,!=3.2.1

(cherry picked from commit 979d750)
jscheffl added a commit to apache/airflow that referenced this issue Oct 21, 2024
WTForms are limited to 3.2.0 because of the error in tests. We technically do not need it directly
as this is a dependency of Flask-WTF, but we need to specify it here to add the limitation
The issue to track it is https://github.com/pallets-eco/wtforms/issues/863
Note. 3.2.0 has been broken because of imports pallets-eco/wtforms#861 which
was fixed in 3.2.1, but after import was fixed, the tests started to work with 3.2.1
when the issue 863 is fixed, we should likely leave the line below and specify !=3.2.0,!=3.2.1

(cherry picked from commit 979d750)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
utkarsharma2 pushed a commit to apache/airflow that referenced this issue Oct 23, 2024
WTForms are limited to 3.2.0 because of the error in tests. We technically do not need it directly
as this is a dependency of Flask-WTF, but we need to specify it here to add the limitation
The issue to track it is https://github.com/pallets-eco/wtforms/issues/863
Note. 3.2.0 has been broken because of imports pallets-eco/wtforms#861 which
was fixed in 3.2.1, but after import was fixed, the tests started to work with 3.2.1
when the issue 863 is fixed, we should likely leave the line below and specify !=3.2.0,!=3.2.1

(cherry picked from commit 979d750)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
harjeevanmaan pushed a commit to harjeevanmaan/airflow that referenced this issue Oct 23, 2024
WTForms are limited to 3.2.0 because of the error in tests. We technically do not need it directly
as this is a dependency of Flask-WTF, but we need to specify it here to add the limitation
The issue to track it is https://github.com/pallets-eco/wtforms/issues/863
Note. 3.2.0 has been broken because of imports pallets-eco/wtforms#861 which
was fixed in 3.2.1, but after import was fixed, the tests started to work with 3.2.1
when the issue 863 is fixed, we should likely leave the line below and specify !=3.2.0,!=3.2.1
PaulKobow7536 pushed a commit to PaulKobow7536/airflow that referenced this issue Oct 24, 2024
WTForms are limited to 3.2.0 because of the error in tests. We technically do not need it directly
as this is a dependency of Flask-WTF, but we need to specify it here to add the limitation
The issue to track it is https://github.com/pallets-eco/wtforms/issues/863
Note. 3.2.0 has been broken because of imports pallets-eco/wtforms#861 which
was fixed in 3.2.1, but after import was fixed, the tests started to work with 3.2.1
when the issue 863 is fixed, we should likely leave the line below and specify !=3.2.0,!=3.2.1
utkarsharma2 pushed a commit to apache/airflow that referenced this issue Oct 24, 2024
WTForms are limited to 3.2.0 because of the error in tests. We technically do not need it directly
as this is a dependency of Flask-WTF, but we need to specify it here to add the limitation
The issue to track it is https://github.com/pallets-eco/wtforms/issues/863
Note. 3.2.0 has been broken because of imports pallets-eco/wtforms#861 which
was fixed in 3.2.1, but after import was fixed, the tests started to work with 3.2.1
when the issue 863 is fixed, we should likely leave the line below and specify !=3.2.0,!=3.2.1

(cherry picked from commit 979d750)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
ellisms pushed a commit to ellisms/airflow that referenced this issue Nov 13, 2024
WTForms are limited to 3.2.0 because of the error in tests. We technically do not need it directly
as this is a dependency of Flask-WTF, but we need to specify it here to add the limitation
The issue to track it is https://github.com/pallets-eco/wtforms/issues/863
Note. 3.2.0 has been broken because of imports pallets-eco/wtforms#861 which
was fixed in 3.2.1, but after import was fixed, the tests started to work with 3.2.1
when the issue 863 is fixed, we should likely leave the line below and specify !=3.2.0,!=3.2.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behavior
Development

Successfully merging a pull request may close this issue.

3 participants