superset icon indicating copy to clipboard operation
superset copied to clipboard

API: Export: Exporting 2 physical datasets with the same table name but different schema returns only 1 dataset

Open sann05 opened this issue 4 years ago • 7 comments
trafficstars

If you try to export with API 2 datasets with the same database, the same table name but different schemas, it returns you only 1 dataset

Expected results

Exporting of 2 datasets should give you 2 datasets (files)

Actual results

As the export feature uses table name as the file name for export it returns only 1 file for 2 datasets

Screenshots

Created datasets

Exported datasets

How to reproduce the bug

  1. Go to SuperSet web
  2. Create a database (I used Vertica)
  3. Create 2 tables with the same name but with the different schema in the DB
  4. Create 2 SuperSet datasets for the tables from step the previous step.
  5. Create 2 simple table charts for the 1 for each dataset from the previous step. (This step needs to be done as the export dataset endpoint doesn't work as expected, so I'm using chart export endpoint)
  6. Send GET request to https://{superset_host}:{port}/api/v1/chart/export/ and save archive in the response
  7. Unzip the archive and check the amount of files for datasets in {extracted_archive}/dataset/{database_name}/

Environment

(please complete the following information):

  • superset version: Superset 1.1.0
  • python version: Python 3.7.9
  • node.js version: not found

sann05 avatar Aug 09 '21 09:08 sann05

It seems like there is no reason to export charts. Everything that you need to export/import dashboard in the exported JSON from the dashboard endpoint

sann05 avatar Aug 10 '21 11:08 sann05

This is still an issue if users need to use the YAML exports to manage assets in Superset. The same issue exists for dashboard export in YAML format, since the exported files are named using dashboard titles/names.

jhua8970 avatar May 17 '23 14:05 jhua8970

Dashboards and charts use IDs to disambiguate between same-named entities, but datasets do not; this issue is still present on 4.0.1 with YAML dataset exports.

Unfortunately the original reporter closed the issue. Can maintainers please reopen it?

iamed2 avatar May 27 '24 15:05 iamed2

Dashboards and charts use IDs to disambiguate between same-named entities, but datasets do not; this issue is still present on 4.0.1 with YAML dataset exports.

Unfortunately the original reporter closed the issue. Can maintainers please reopen it?

I can reopen that

sann05 avatar May 27 '24 15:05 sann05

Dashboards and charts use IDs to disambiguate between same-named entities, but datasets do not; this issue is still present on 4.0.1 with YAML dataset exports.

Unfortunately the original reporter closed the issue. Can maintainers please reopen it?

Hi! please tell me if there is any news on solving this problem in v4.1.1/4.1.2?

lxrvan avatar Mar 04 '25 11:03 lxrvan

No news that I'm aware of, but I'll ping @betodealmeida and @eschutho since they were looking at what to include (or not) with imports/exports in the not-so-distant past.

Obviously we're open to a PR if anyone needs to dig into this more urgently.

rusackas avatar Mar 04 '25 19:03 rusackas

@geido can we put a bug bounty on this?

eschutho avatar Mar 14 '25 23:03 eschutho