question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Databases export/import yaml file bug

See original GitHub issue

Superset bug in exporting datasources from the web application, the errors it produces while importing and a simple workaround to whoever needs it.

Exporting the databases list from http://localhost:8088/databaseview/list/ will result in a missing leading key of the databases in the .yaml file.

To reproduce error

  1. Go to http://localhost:8088/databaseview/list/ export_datasource The exported .yaml file from selecting all databases from the list will look like this
- database_name: main
  sqlalchemy_uri: postgresql://superset:XXXXXXXXXX@postgres:5432/superset
  tables: []
- database_name: examples
  sqlalchemy_uri: postgresql://superset:XXXXXXXXXX@postgres:5432/superset
  tables: []
  1. Import datasources to superset (from the docker container or your environment)
superset import_datasources -p <filename>.yaml

result:

2019-10-25 19:54:52,264:INFO:root:Supplied object is not a dictionary.
error_import

Reasons

  • The datasources are not imported correctly

  • The reason is simply because of the leading key in the .yaml file is missing.

  • A bug while generating the .yaml file

Simple fix

  1. Editing .yaml file manually after exporting from the first picture attached
databases:
    - database_name: main
    sqlalchemy_uri: postgresql://superset:XXXXXXXXXX@postgres:5432/superset
    tables: []
    - database_name: examples
    sqlalchemy_uri: postgresql://superset:XXXXXXXXXX@postgres:5432/superset
    tables: []
import_success
  1. Use the export command from terminal, which generates a correct .yaml file
superset export_datasources -p <filename>.yaml

This exports the .yaml correctly with the leading databases key export_success

Environment

Using docker image in the development mode. superset: 0.34.0 python: 3.6 docker: 19.03.4, build 9013bf5

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dpgasparcommented, Nov 10, 2019

Hi @ibrahimroshdy this is fixed on master now.

0reactions
dpgasparcommented, Oct 30, 2019

Hi @ibrahimroshdy, @villebro,

I’ll submit a PR to fix this

Read more comments on GitHub >

github_iconTop Results From Across the Web

Databases export/import yaml file bug · Issue #8453 - GitHub
Superset bug in exporting datasources from the web application, the errors it produces while importing and a simple workaround to whoever needs ...
Read more >
Cannot export/import or copy APEX application — oracle-tech
I have now solved this problem by looking at the result of importing the exported file with SQKL developer. The problem ocurred when...
Read more >
XML Backups and Space Export/Import Troubleshooting
The one operation for which an XML backup is required is database migration. ... or enable debug logging on a space export/import, you...
Read more >
Content Export YAML | Drupal.org
For import : if Entity ID is exist in Database , it will be replace . The export process is not export the...
Read more >
FIX: Errors when you use export/import data wizard to move ...
Fixes an issue in which errors occur when you move data in SSMS by using export/import data wizard with option "Write a query...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found