Incubator-superset: error when export datasources

Created on 8 Apr 2018  路  7Comments  路  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.24.0

Expected results

create the yaml file successful

Actual results

$ superset export_datasources
2018-04-08 17:18:57,891:INFO:root:Starting export
Traceback (most recent call last):
File "/home/xxx/.virtualenvs/yyy/bin/superset", line 15, in
manager.run()
File "/home/xxx/.virtualenvs/yyy/lib/python3.5/site-packages/flask_script/__init__.py", line 417, in run
result = self.handle(argv[0], argv[1:])
File "/home/xxx/.virtualenvs/yyy/lib/python3.5/site-packages/flask_script/__init__.py", line 386, in handle
res = handle(args, *config)
File "/home/xxx/.virtualenvs/yyy/lib/python3.5/site-packages/flask_script/commands.py", line 216, in __call__
return self.run(args, *kwargs)
File "/home/xxx/.virtualenvs/yyy/lib/python3.5/site-packages/superset/cli.py", line 251, in export_datasources
include_defaults=include_defaults)
File "/home/xxx/.virtualenvs/yyy/lib/python3.5/site-packages/superset/dict_import_export_util.py", line 40, in export_to_dict
include_defaults=include_defaults) for database in dbs]
File "/home/xxx/.virtualenvs/yyy/lib/python3.5/site-packages/superset/dict_import_export_util.py", line 40, in
include_defaults=include_defaults) for database in dbs]
File "/home/xxx/.virtualenvs/yyy/lib/python3.5/site-packages/superset/models/helpers.py", line 196, in export_to_dict
key=lambda k: sorted(k.items()))
TypeError: : unorderable types: dict() < dict()

Steps to reproduce

  1. Add the mssql datasource
  2. Create the dashboard
  3. from command line , run "superset export_datasources"
inactive

Most helpful comment

Exporting worked on my development version after the sorted function is removed from helpers.py file.
file: helpers.py
export_to_dict
replace "key=lambda k: sorted(k.items()))" with "key=lambda k: (k.items()))"

All 7 comments

see https://github.com/attardi/deepnl/issues/54

export is need python2.7, but import is py3 better (avoid UnicodeEncodeError)
btw, i use py2 to export, and py3 to import, it works right. (not need Cython)

Hi,

I Had the same error when trying to export datasources.
Superset version : 0.26.3
Python version : 3.6.3

Error :

Loaded your LOCAL configuration at [/opt/superset/venv3/bin/superset_config.py]
2018-08-27 11:25:40,921:INFO:root:Starting export
Traceback (most recent call last):
File "/opt/superset/venv3/bin/superset", line 15, in
manager.run()
File "/opt/superset/venv3/lib/python3.6/site-packages/flask_script/__init__.py", line 417, in run
result = self.handle(argv[0], argv[1:])
File "/opt/superset/venv3/lib/python3.6/site-packages/flask_script/__init__.py", line 386, in handle
res = handle(args, *config)
File "/opt/superset/venv3/lib/python3.6/site-packages/flask_script/commands.py", line 216, in __call__
return self.run(args, *kwargs)
File "/opt/superset/venv3/lib/python3.6/site-packages/superset/cli.py", line 290, in export_datasources
include_defaults=include_defaults)
File "/opt/superset/venv3/lib/python3.6/site-packages/superset/dict_import_export_util.py", line 41, in export_to_dict
include_defaults=include_defaults) for database in dbs]
File "/opt/superset/venv3/lib/python3.6/site-packages/superset/dict_import_export_util.py", line 41, in
include_defaults=include_defaults) for database in dbs]
File "/opt/superset/venv3/lib/python3.6/site-packages/superset/models/helpers.py", line 206, in export_to_dict
key=lambda k: sorted(k.items()))
TypeError: : '<' not supported between instances of 'dict' and 'dict'

Did you managed to solve it ?

Thank you.

Exporting worked on my development version after the sorted function is removed from helpers.py file.
file: helpers.py
export_to_dict
replace "key=lambda k: sorted(k.items()))" with "key=lambda k: (k.items()))"

I'm hitting this as well. I'll see how hard it is to test my fix, but I've pushed up a branch here: https://github.com/apache/incubator-superset/commit/710f0e4b99f355ddabb76d81cb4230d461984b20

@chancez after using your changes I am getting this error now for that line: TypeError: '<' not supported between instances of 'bool' and 'str'

Yah, I hit that too. I haven't had time to revisit this.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

XiaodiKong picture XiaodiKong  路  3Comments

fly-high-bj picture fly-high-bj  路  3Comments

thoralf-gutierrez picture thoralf-gutierrez  路  3Comments

gbrian picture gbrian  路  3Comments

josephtyler picture josephtyler  路  3Comments