Incubator-superset: Not able to import dashboard in the latest version of superset

Created on 26 Oct 2018  路  19Comments  路  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.999.0dev

Expected results

Actual results

Steps to reproduce

I have two latest superset running on different servers. I exported the dashboard and try to import it into other superset but cannot. Please help me

inactive

Most helpful comment

Yes both on python 3. Even I tried to import back into the same superset, I got errors.

These are the errors:

Traceback (most recent call last): File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise raise value File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request() File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/home/syazwan/incubator-superset/superset/models/core.py", line 1037, in wrapper value = f(*args, **kwargs) File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask_appbuilder/security/decorators.py", line 26, in wraps return f(self, *args, **kwargs) File "/home/syazwan/incubator-superset/superset/views/core.py", line 1260, in import_dashboards dashboard_import_export.import_dashboards(db.session, f.stream) File "/home/syazwan/incubator-superset/superset/utils/dashboard_import_export.py", line 22, in import_dashboards type(table).import_obj(table, import_time=import_time) AttributeError: type object 'dict' has no attribute 'import_obj'

All 19 comments

Both on python 3? Stacktrace?

Yes both on python 3. Even I tried to import back into the same superset, I got errors.

These are the errors:

Traceback (most recent call last): File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise raise value File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request() File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/home/syazwan/incubator-superset/superset/models/core.py", line 1037, in wrapper value = f(*args, **kwargs) File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask_appbuilder/security/decorators.py", line 26, in wraps return f(self, *args, **kwargs) File "/home/syazwan/incubator-superset/superset/views/core.py", line 1260, in import_dashboards dashboard_import_export.import_dashboards(db.session, f.stream) File "/home/syazwan/incubator-superset/superset/utils/dashboard_import_export.py", line 22, in import_dashboards type(table).import_obj(table, import_time=import_time) AttributeError: type object 'dict' has no attribute 'import_obj'

Yes both on python 3. Even I tried to import back into the same superset, I got errors.

These are the errors:

Traceback (most recent call last):
  File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/syazwan/incubator-superset/superset/models/core.py", line 1037, in wrapper
    value = f(*args, **kwargs)
  File "/home/syazwan/anaconda2/envs/jps2018/lib/python3.6/site-packages/flask_appbuilder/security/decorators.py", line 26, in wraps
    return f(self, *args, **kwargs)
  File "/home/syazwan/incubator-superset/superset/views/core.py", line 1260, in import_dashboards
    dashboard_import_export.import_dashboards(db.session, f.stream)
  File "/home/syazwan/incubator-superset/superset/utils/dashboard_import_export.py", line 22, in import_dashboards
    type(table).import_obj(table, import_time=import_time)
AttributeError: type object 'dict' has no attribute 'import_obj'```

yeah same issue. I have Python 3.6 and latest superset.....

@mistercrunch so how to fix it?

+1

Same issue with me too

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

same issue here.

same issue here.

so how to fix it? Anybody shine some light on it?

same issue here.

There's some work being done on import / export recently, with a new cli utility and improved logic.

@mistercrunch is it fixed already? because some dashboards can be imported but some cannot.

Only dashboard with Druid datasources cannot be imported

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

Same issue here.

My boss detected it.

Bug's not dead.

Same issue here:

Superset version 0.30.0
Running on Windows10

I wanted to investigate import_dashboards feature to execute DTAP pipeline.

  • I saved as one of the existing dashboards. (named it "testSelcuk" )

  • Then exported this new dashboard as JSON file.

  • Then deleted this dashboard.

  • then typed python import_dashboards -f "path of testSelcuk"

I reveive the error : 2019-10-28 08:30:45,544:ERROR:root:(sqlite3.IntegrityError) UNIQUE constraint failed: tables.table_name
[SQL: INSERT INTO tables (created_on, changed_on, description, default_endpoint, is_featured, filter_select_enabled, "offset", cache_timeout, params, perm, table_name, main_dttm_col, database_id, fetch_values_predicate, schema, sql, is_sqllab_view, template_params, created_by_fk, changed_by_fk) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]
[parameters: ('2019-10-28 08:30:45.544436', '2019-10-28 08:30:45.544436', '