apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
60.4k stars 13.03k forks source link

JSON export not capturing column infos #25183

Closed superset-user closed 2 months ago

superset-user commented 10 months ago

After migration from Superset 1.4.2 to 2.1.0, I noticed that JSON backups of dashboards fails to capture column information which leads to failed charts and filters after opening a dashboard. I am using a deployment script to deploy and take backup of dashboards as JSON files

How to reproduce the bug

Run command for taking dashboard backup:

Expected results

dashboard backup JSON file with following structure:

"datasources": [
    {
        "__SqlaTable__": {
            "cache_timeout": null,
            "columns": [
                {
                    "__TableColumn__": {
                        "changed_by_fk": 26,
                        "changed_on": {
                            "__datetime__": "2023-08-04T11:32:59"
                        },
                        "column_name": "brand_name",
                        "created_by_fk": 26,
                        "created_on": {
                            "__datetime__": "2023-08-04T11:32:59"
                        },
                        "description": null,
                        "expression": null,
                        "extra": "{}",
                        "filterable": true, ...

Actual results

However, getting this:

"datasources": [
        {
            "__SqlaTable__": {
                "cache_timeout": null,
                "database_id": 1,
                "default_endpoint": null,
                "description": null,
                "extra": null,
                "fetch_values_predicate": null,
                "filter_select_enabled": false,
                "main_dttm_col": null,
                "offset": 0,
                "params": "{\"remote_id\": 27571, \"database_name\": \"presto\", \"import_time\": 1693913439}",
                "schema": "itam", ...

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

(please complete the following information):

Checklist

Make sure to follow these steps before submitting your issue - thank you!

Additional context

As we can see that in actual results the columns information is missing in JSON file, so after deployment the datasets column list is empty:

image

due to that charts are failing on dashboards as they failed to find columns in datasets (sync columns from source works but its impossible to go to every dataset and click sync columns from source button).

We recently upgraded to version 2.1.0 from 1.4.2. Everything was working fine before upgrade.

Can anyone help me and show how can we capture this columns (as shown in expected results) information in JSON files for 2.1.0 version of superset.

Thanks in advance!

superset-user commented 7 months ago

Hi all. Can anyone help? TIA!

rusackas commented 2 months ago

I'm not sure if this is still an issue in current versions of Superset (3.1/4.0). If it is, we can re-open this, or feel free to open a new issue with updated context and a reproducible case using example data. We're no longer supporting Superset 2.x or prior, and it's been a while since this thread saw any activity, so I'm closing this as stale.