Incubator-superset: Install fresh 025rc1 - gives me TypeError: make_declarative_base() takes at most 2 arguments (3 given)

Created on 27 Apr 2018  路  15Comments  路  Source: apache/incubator-superset

Make sure these boxes are checked before submitting your issue - thank you!

  • [ x] I have checked the superset logs for python stacktraces and included it here as text if any
  • [x ] I have reproduced the issue with at least the latest released version of superset
  • [ x] I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.25rc1

Expected results

Should be a valid install?

Actual results

Traceback (most recent call last):
File "/home/derwin/venvbeta/bin/superset", line 12, in
from superset.cli import manager
File "/home/derwin/venvbeta/local/lib/python2.7/site-packages/superset/__init__.py", line 89, in
db = SQLA(app)
File "/home/derwin/venvbeta/local/lib/python2.7/site-packages/flask_sqlalchemy/__init__.py", line 677, in __init__
self.Model = self.make_declarative_base(model_class, metadata)
TypeError: make_declarative_base() takes at most 2 arguments (3 given)

Steps to reproduce

virtualenv venvbeta
. ./venvbeta/bin/activate
pip install --upgrade setuptools pip
pip install mysqlclient
pip install redis
pip install pybigquery
pip install --upgrade https://github.com/airbnb/superset/tarball/0.25.0rc1
cd venvbeta
cd bin
cp /home/derwin/myvenv/bin/superset_config.py .
superset db upgrade
/home/derwin/venvbeta/local/lib/python2.7/site-packages/sqlalchemy/ext/declarative/api.py:405: FSADeprecationWarning: "_BoundDeclarativeMeta" has been renamed to "DefaultMeta". The old name will be removed in 3.0.
return declarative_base(**kw)
Loaded your LOCAL configuration at [/home/derwin/venvbeta/bin/superset_config.pyc]
/home/derwin/venvbeta/local/lib/python2.7/site-packages/superset/security.py:11: FSADeprecationWarning: "_BoundDeclarativeMeta" has been renamed to "DefaultMeta". The old name will be removed in 3.0.
from flask_appbuilder.security.sqla import models as ab_models
/home/derwin/venvbeta/local/lib/python2.7/site-packages/superset/security.py:11: FSADeprecationWarning: "_BoundDeclarativeMeta" has been renamed to "DefaultMeta". The old name will be removed in 3.0.
from flask_appbuilder.security.sqla import models as ab_models
/home/derwin/venvbeta/local/lib/python2.7/site-packages/superset/security.py:11: FSADeprecationWarning: "_BoundDeclarativeMeta" has been renamed to "DefaultMeta". The old name will be removed in 3.0.
from flask_appbuilder.security.sqla import models as ab_models
/home/derwin/venvbeta/local/lib/python2.7/site-packages/superset/security.py:11: FSADeprecationWarning: "_BoundDeclarativeMeta" has been renamed to "DefaultMeta". The old name will be removed in 3.0.
from flask_appbuilder.security.sqla import models as ab_models
/home/derwin/venvbeta/local/lib/python2.7/site-packages/superset/security.py:11: FSADeprecationWarning: "_BoundDeclarativeMeta" has been renamed to "DefaultMeta". The old name will be removed in 3.0.
from flask_appbuilder.security.sqla import models as ab_models
/home/derwin/venvbeta/local/lib/python2.7/site-packages/superset/security.py:11: FSADeprecationWarning: "_BoundDeclarativeMeta" has been renamed to "DefaultMeta". The old name will be removed in 3.0.
from flask_appbuilder.security.sqla import models as ab_models
Traceback (most recent call last):
File "/home/derwin/venvbeta/bin/superset", line 12, in
from superset.cli import manager
File "/home/derwin/venvbeta/local/lib/python2.7/site-packages/superset/__init__.py", line 89, in
db = SQLA(app)
File "/home/derwin/venvbeta/local/lib/python2.7/site-packages/flask_sqlalchemy/__init__.py", line 677, in __init__
self.Model = self.make_declarative_base(model_class, metadata)
TypeError: make_declarative_base() takes at most 2 arguments (3 given)

Can someone point me to what I messed up?
ubuntu 14 I think with python 2.7.12

Most helpful comment

Is this the correct answer?
pip uninstall flask-sqlalchemy
pip install flask-sqlalchemy==2.1
superset db upgrade

All 15 comments

(venvbeta) :~/venvbeta/bin$ pip freeze
alembic==0.9.9
amqp==2.2.2
asn1crypto==0.24.0
Babel==2.5.3
backports-abc==0.5
billiard==3.5.0.3
bleach==2.1.3
boto3==1.7.10
botocore==1.10.10
cachetools==2.0.1
celery==4.1.0
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
click==6.7
colorama==0.3.9
cryptography==2.2.2
docutils==0.14
enum34==1.1.6
Flask==1.0
Flask-AppBuilder==1.10.0
Flask-Babel==0.11.1
Flask-Cache==0.13.1
Flask-Compress==1.4.0
Flask-Login==0.2.11
Flask-Migrate==2.1.1
Flask-OpenID==1.2.5
Flask-Script==2.0.6
Flask-SQLAlchemy==2.3.2
Flask-Testing==0.7.1
Flask-WTF==0.14.2
flower==0.9.2
future==0.16.0
futures==3.2.0
geographiclib==1.49
geopy==1.13.0
google-api-core==1.1.1
google-auth==1.4.1
google-cloud-bigquery==1.1.0
google-cloud-core==0.28.1
google-resumable-media==0.3.1
googleapis-common-protos==1.5.3
gunicorn==19.7.1
html5lib==1.0.1
humanize==0.5.1
idna==2.6
ipaddress==1.0.22
itsdangerous==0.24
Jinja2==2.10
jmespath==0.9.3
kombu==4.1.0
Mako==1.0.7
Markdown==2.6.11
MarkupSafe==1.0
mysqlclient==1.3.12
numpy==1.14.2
pandas==0.22.0
parsedatetime==2.4
pathlib2==2.3.2
polyline==1.3.2
protobuf==3.5.2.post1
pyasn1==0.4.2
pyasn1-modules==0.2.1
pybigquery==0.2.8
pycparser==2.18
pydruid==0.4.2
PyHive==0.5.1
python-dateutil==2.7.2
python-editor==1.0.3
python-geohash==0.8.5
python-openid==2.2.5
pytz==2018.4
PyYAML==3.12
redis==2.10.6
requests==2.18.4
rsa==3.4.2
s3transfer==0.1.13
sasl==0.2.1
scandir==1.7
simplejson==3.14.0
singledispatch==3.4.0.3
six==1.11.0
SQLAlchemy==1.2.7
SQLAlchemy-Utils==0.33.2
sqlparse==0.2.4
superset==0.25.0rc1
thrift==0.11.0
thrift-sasl==0.3.0
tornado==5.0.2
unicodecsv==0.14.1
Unidecode==1.0.22
urllib3==1.22
vine==1.1.4
webencodings==0.5.1
Werkzeug==0.14.1
WTForms==2.1

Is this the correct answer?
pip uninstall flask-sqlalchemy
pip install flask-sqlalchemy==2.1
superset db upgrade

I had to:
edit /home/derwin/venvbeta/local/lib/python2.7/site-packages/superset/migrations/versions/289ce07647b_add_encrypted_password_field.py
And use

from sqlalchemy_utils.types.encrypted import EncryptedType

from sqlalchemy_utils import EncryptedTyp

Add New Slice doesnt show the css template..
Looking into notes:

assuming $SUPERSET_HOME as the root of the repo

cd $SUPERSET_HOME/superset/assets
yarn
yarn run build
cd $SUPERSET_HOME
python setup.py install

I dont see a superset/assets ... I found
./lib/python2.7/site-packages/superset/static/assets

Stuck....
yarn run build
yarn run v1.5.1
warning You are using Node "4.2.6" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0"
$ NODE_ENV=production webpack --colors --progress
sh: 1: webpack: not found
error An unexpected error occurred: "Command failed.
Exit code: 127
Command: sh
Arguments: -c NODE_ENV=production webpack --colors --progress
Directory: /home/derwin/venvbeta/lib/python2.7/site-packages/superset/static/assets
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/home/derwin/venvbeta/lib/python2.7/site-packages/superset/static/assets/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

You have to install from requirements.txt before installing. And upgrade node as the errors suggests. And then please don't spam the issue with a stream of messages, don't rush to write something and update the same one if you have news.

0.25.0rc2 has some setup.py fixes that should help with those issues

The idea is to pin a minimum in setup.py to give users more flexibility, and to pin things in requirements.txt which becomes some sort of "reference implementation", the one we build against.

While pining a minimum, we need to make sure pip install superset is going to work properly since that only uses what is defined in setup.py

I will try with the later versions and do the pip install -r /path/to/requirements.txt

No problems at all with the 025rc3 install using requirements.txt
virtualenv venv25
. ./venv25/bin/activate
created new database in mysql
copy over bin/superset_config.py from prior install to bin/
pip install mysqlclient
pip install redis
pip install pybigquery
https://raw.githubusercontent.com/apache/incubator-superset/master/requirements.txt
pip install -r requirements.txt
pip install --upgrade https://github.com/airbnb/superset/tarball/0.25.0rc3
fabmanager create-admin --app superset
superset db upgrade
superset load_examples
superset init

I can see this in Console

sqlalchemy.exc.OperationalError
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: dbs [SQL: 'SELECT count(?) AS count_1 nFROM dbs'] [parameters: ('*',)] (Background on this error at: http://sqlalche.me/e/e3q8)

Traceback (most recent call last):
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\flask\app.py", line 1997, in __call__
return self.wsgi_app(environ, start_response)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\flask\app.py", line 1985, in wsgi_app
response = self.handle_exception(e)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\flask\app.py", line 1540, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\flask_compat.py", line 33, in reraise
raise value
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\flask\app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\flask\app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\flask\app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\flask_compat.py", line 33, in reraise
raise value
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\flask\app.py", line 1598, in dispatch_request
return self.view_functionsrule.endpoint
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\flask_appbuilder\security\decorators.py", line 26, in wraps
return f(self, args, *kwargs)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\flask_appbuilder\views.py", line 475, in list
widgets = self._list()
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\flask_appbuilderbaseviews.py", line 883, in _list
page_size=page_size)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\flask_appbuilderbaseviews.py", line 793, in _get_list_widget
count, lst = self.datamodel.query(joined_filters, order_column, order_direction, page=page, page_size=page_size)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\flask_appbuilder\models\sqla\interface.py", line 115, in query
count = query_count.scalar()
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\sqlalchemy\orm\query.py", line 2913, in scalar
ret = self.one()
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\sqlalchemy\orm\query.py", line 2884, in one
ret = self.one_or_none()
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\sqlalchemy\orm\query.py", line 2854, in one_or_none
ret = list(self)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\sqlalchemy\orm\query.py", line 2925, in __iter__
return self._execute_and_instances(context)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\sqlalchemy\orm\query.py", line 2948, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\sqlalchemy\enginebase.py", line 948, in execute
return meth(self, multiparams, params)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\sqlalchemy\sql\elements.py", line 269, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\sqlalchemy\enginebase.py", line 1060, in _execute_clauseelement
compiled_sql, distilled_params
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\sqlalchemy\enginebase.py", line 1200, in _execute_context
context)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\sqlalchemy\enginebase.py", line 1413, in _handle_dbapi_exception
exc_info
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\sqlalchemy\util\compat.py", line 203, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\sqlalchemy\util\compat.py", line 186, in reraise
raise value.with_traceback(tb)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\sqlalchemy\enginebase.py", line 1193, in _execute_context
context)
File "C:\Users\vsingh2\AppData\Local\Programs\Python\Python36\Scripts\demo\lib\site-packages\sqlalchemy\engine\default.py", line 507, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: dbs [SQL: 'SELECT count(?) AS count_1 nFROM dbs'] [parameters: ('*',)] (Background on this error at: http://sqlalche.me/e/e3q8)

Your message seems to imply that the table doesnt exist :-) perhaps you need to preface with the schema owner?

someowner.dbs ?

Hi there . i am getting similar error when i try to run superset runserver , can anybody provide any solution?

ubuntu@ip-x-x-x-x:~$ superset runserver
/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative/api.py:405: FSADeprecationWarning: "_BoundDeclarativeMeta" has been renamed to "DefaultMeta". The old name will be removed in 3.0.
return declarative_base(**kw)
/usr/local/lib/python2.7/dist-packages/superset/security.py:12: FSADeprecationWarning: "_BoundDeclarativeMeta" has been renamed to "DefaultMeta". The old name will be removed in 3.0.
from flask_appbuilder.security.sqla import models as ab_models
/usr/local/lib/python2.7/dist-packages/superset/security.py:12: FSADeprecationWarning: "_BoundDeclarativeMeta" has been renamed to "DefaultMeta". The old name will be removed in 3.0.
from flask_appbuilder.security.sqla import models as ab_models
/usr/local/lib/python2.7/dist-packages/superset/security.py:12: FSADeprecationWarning: "_BoundDeclarativeMeta" has been renamed to "DefaultMeta". The old name will be removed in 3.0.
from flask_appbuilder.security.sqla import models as ab_models
/usr/local/lib/python2.7/dist-packages/superset/security.py:12: FSADeprecationWarning: "_BoundDeclarativeMeta" has been renamed to "DefaultMeta". The old name will be removed in 3.0.
from flask_appbuilder.security.sqla import models as ab_models
/usr/local/lib/python2.7/dist-packages/superset/security.py:12: FSADeprecationWarning: "_BoundDeclarativeMeta" has been renamed to "DefaultMeta". The old name will be removed in 3.0.
from flask_appbuilder.security.sqla import models as ab_models
/usr/local/lib/python2.7/dist-packages/superset/security.py:12: FSADeprecationWarning: "_BoundDeclarativeMeta" has been renamed to "DefaultMeta". The old name will be removed in 3.0.
from flask_appbuilder.security.sqla import models as ab_models
Traceback (most recent call last):
File "/usr/local/bin/superset", line 12, in
from superset.cli import manager
File "/usr/local/lib/python2.7/dist-packages/superset/__init__.py", line 90, in
db = SQLA(app)
File "/usr/local/lib/python2.7/dist-packages/flask_sqlalchemy/__init__.py", line 677, in __init__
self.Model = self.make_declarative_base(model_class, metadata)
TypeError: make_declarative_base() takes at most 2 arguments (3 given)

I am seeing same error as @desmondiazz from flask_sqlalchemy

TypeError: make_declarative_base() takes at most 2 arguments (3 given)

Versions of relevant packages:

Python: 2.7.5
superset (0.27.0)
Flask-SQLAlchemy (2.3.2)
SQLAlchemy (1.2.12)
SQLAlchemy-Utils (0.33.5)

-edit-

Downgrade of Flask-SQLAlchemy to 2.1 as detailed by @darylerwin above resolved the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

deity-bram picture deity-bram  路  3Comments

amien90 picture amien90  路  3Comments

josephtyler picture josephtyler  路  3Comments

dinhhuydh picture dinhhuydh  路  3Comments

lenguyenthedat picture lenguyenthedat  路  3Comments