Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard filters scopes are not carried while export/import dashboards #19944

Open
3 tasks
stefanocascavilla opened this issue May 4, 2022 · 14 comments
Open
3 tasks
Labels
#bug Bug report validation:required A committer should validate the issue

Comments

@stefanocascavilla
Copy link

We are currently using Superset 1.4.2 (but we just checked it also with the 1.5.0 version) and we are experiencing an issue while exporting and importing a dashboard.
The filters defined ad the dashboard level don't follow the scoping defined. They are automatically applied to all charts, even if a different scoping was defined before the export.

How to reproduce the bug

  1. Focus on a Dashboard you want, and export it (you will download the JSON file)
  2. Hover on Settings and select Import Dashboards
  3. Choose the JSON file you previously downloaded and select the database you want the dashboard to point to
  4. Click on Upload.
  5. Move to the imported dashboard
  6. Expand the dashboard's filters section

Expected results

We expect to have the same scoping as in the original dashboard for the filters

Actual results

The scoping is not carried while the export, so all the filters are automatically applied to all the charts.

Environment

(please complete the following information):

  • superset version: 1.4.2
  • any feature flags active: We currently have the VERSIONED_EXPORT feature flag disabled.

Checklist

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

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.
@stefanocascavilla stefanocascavilla added the #bug Bug report label May 4, 2022
@andreabrumana
Copy link

+1

2 similar comments
@andreabrumana
Copy link

+1

@FedericoCalonge
Copy link

+1

@ShaliniIruvuru
Copy link

ShaliniIruvuru commented Mar 20, 2023

Working as Expected.
Loom video:-
https://www.loom.com/share/748dad4825c148678c5b73f0a5fbf042

@LeoDiep
Copy link

LeoDiep commented Jun 7, 2023

facing the same problem while import from v1.5.0 to v2.1.0.
Also there is a notice appear everytime accessing to the imported dashboard: Error loading chart datasources. Filters may not work correctly. Although I have changed the scope as it is as the old dashboard and it work just fine as the old one. This notice confuse users and annoyin.

@Sonalit23
Copy link

Sonalit23 commented Jun 15, 2023

Facing the same issue with Cross Filter scoping.
Steps to reproduce:

  1. Create a dashboard with more than one or two chart. (My dashboard was with 3 tabs and 6 charts.)
  2. enable cross filter
  3. Restrict cross-filtering for any chart to none. That is, Apply to specific panels -> deselect all panels
  4. Export the dashboard
  5. Delete the dashboard and their corresponding charts
  6. Import dashboard
    Actual result:
    Cross filter scoping will remain Apply to all panels for all charts.

Expected result:
Import should preserve the cross filter scoping for a chart.

Observation: Importing the dashboard seems to assign the new chart ids. Check the properties of a dashboard (edit dashboard -> edit properties -> advance JSON metadata)

"chart_configuration": {
    "1": {
      "id": 1,
      "crossFilters": {
        "scope": {"rootPath": [], "excluded": [1]},
        "chartsInScope": []
      }
    },
    "2": {
      "id": 2,
      "crossFilters": {
        "scope": {"rootPath": [], "excluded": [2]},
        "chartsInScope": []
      }
    },
    "3": {
      "id": 3,
      "crossFilters": {
        "scope": {"rootPath": ["ROOT_ID"], "excluded": [3]},
        "chartsInScope": [1, 2, 4, 5, 6]
      }
    },
    "4": {
      "id": 4,
      "crossFilters": {
        "scope": {"rootPath": ["ROOT_ID"], "excluded": [4]},
        "chartsInScope": [1, 2, 3, 5, 6]
      }
    },
    "5": {
      "id": 5,
      "crossFilters": {
        "scope": {"rootPath": [], "excluded": [5]},
        "chartsInScope": []
      }
    },
    "6": {
      "id": 6,
      "crossFilters": {
        "scope": {"rootPath": [], "excluded": [6]},
        "chartsInScope": []
      }
    },
    "37": {
      "id": 37,
      "crossFilters": {
        "scope": {"rootPath": ["ROOT_ID"], "excluded": [37]},
        "chartsInScope": [38, 39, 40, 41, 42]
      }
    },
    "38": {
      "id": 38,
      "crossFilters": {
        "scope": {"rootPath": ["ROOT_ID"], "excluded": [38]},
        "chartsInScope": [37, 39, 40, 41, 42]
      }
    },
    "39": {
      "id": 39,
      "crossFilters": {
        "scope": {"rootPath": ["ROOT_ID"], "excluded": [39]},
        "chartsInScope": [37, 38, 40, 41, 42]
      }
    },
    "40": {
      "id": 40,
      "crossFilters": {
        "scope": {"rootPath": ["ROOT_ID"], "excluded": [40]},
        "chartsInScope": [37, 38, 39, 41, 42]
      }
    },
    "41": {
      "id": 41,
      "crossFilters": {
        "scope": {"rootPath": ["ROOT_ID"], "excluded": [41]},
        "chartsInScope": [37, 38, 39, 40, 42]
      }
    },
    "42": {
      "id": 42,
      "crossFilters": {
        "scope": {"rootPath": ["ROOT_ID"], "excluded": [42]},
        "chartsInScope": [37, 38, 39, 40, 41]
      }
    }
  }

The chart ids 1, 2, 3, 4, 5, 6 were the old chart ids when I exported the dashboard first time. It has correct cross-filter scoping. Deleting a dashboard and corresponding charts, importing the dashboard generates new chart ids (from 37 to 42) and assigns apply to all panels cross filter scoping to all charts.
If you export the dashboard again, you can able to see the new chart ids in the dashboard's yaml file.

@LeoDiep
Copy link

LeoDiep commented Jun 16, 2023

facing the same problem while import from v1.5.0 to v2.1.0. Also there is a notice appear everytime accessing to the imported dashboard: Error loading chart datasources. Filters may not work correctly. Although I have changed the scope as it is as the old dashboard and it work just fine as the old one. This notice confuse users and annoyin.

I have to go to every chart and click Save again to make the notification dissapear.

Facing the same issue with Cross Filter scoping. Steps to reproduce:

  1. Create a dashboard with more than one or two chart. (My dashboard was with 3 tabs and 6 charts.)
  2. enable cross filter
  3. Restrict cross-filtering for any chart to none. That is, Apply to specific panels -> deselect all panels
  4. Export the dashboard
  5. Delete the dashboard and their corresponding charts
  6. Import dashboard
    Actual result:
    Cross filter scoping will remain Apply to all panels for all charts.

Expected result: Import should preserve the cross filter scoping for a chart.

Observation: Importing the dashboard seems to assign the new chart ids. Check the properties of a dashboard (edit dashboard -> edit properties -> advance JSON metadata)

The chart ids 1, 2, 3, 4, 5, 6 were the old chart ids when I exported the dashboard first time. It has correct cross-filter scoping. Deleting a dashboard and corresponding charts, importing the dashboard generates new chart ids (from 37 to 42) and assigns apply to all panels cross filter scoping to all charts. If you export the dashboard again, you can able to see the new chart ids in the dashboard's yaml file.

I guess this was because the Superset launching by docker already have chart ids from 1 to 36 as example charts

@Sonalit23
Copy link

Sonalit23 commented Jun 16, 2023

I guess this was because the Superset launching by docker already have chart ids from 1 to 36 as example charts

Yes, still it should preserve the scoping of cross filters with import functionality.
I tried modifying the yaml file with higher chartIds (superset doesn’t have it already) but still it assigns new IDs and may be cross filter scoping isn’t bind with chart Ids.
Apparently native filters scoping works fine but not cross filter scoping.

"chart_configuration": {
    "49": {
      "id": 49,
      "crossFilters": {
        "scope": {"rootPath": ["ROOT_ID"], "excluded": [49]},
        "chartsInScope": [50, 51, 52, 53, 54]
      }
    },
    "50": {
      "id": 50,
      "crossFilters": {
        "scope": {"rootPath": ["ROOT_ID"], "excluded": [50]},
        "chartsInScope": [49, 51, 52, 53, 54]
      }
    },
    "51": {
      "id": 51,
      "crossFilters": {
        "scope": {"rootPath": ["ROOT_ID"], "excluded": [51]},
        "chartsInScope": [49, 50, 52, 53, 54]
      }
    },
    "52": {
      "id": 52,
      "crossFilters": {
        "scope": {"rootPath": ["ROOT_ID"], "excluded": [52]},
        "chartsInScope": [49, 50, 51, 53, 54]
      }
    },
    "53": {
      "id": 53,
      "crossFilters": {
        "scope": {"rootPath": ["ROOT_ID"], "excluded": [53]},
        "chartsInScope": [49, 50, 51, 52, 54]
      }
    },
    "54": {
      "id": 54,
      "crossFilters": {
        "scope": {"rootPath": ["ROOT_ID"], "excluded": [54]},
        "chartsInScope": [49, 50, 51, 52, 53]
      }
    },
    "501": {
      "id": 501,
      "crossFilters": {
        "scope": {"rootPath": [], "excluded": [501]},
        "chartsInScope": []
      }
    },
    "502": {
      "id": 502,
      "crossFilters": {
        "scope": {"rootPath": [], "excluded": [502]},
        "chartsInScope": []
      }
    },
    "503": {
      "id": 503,
      "crossFilters": {
        "scope": {"rootPath": ["ROOT_ID"], "excluded": [503]},
        "chartsInScope": [501, 502, 504, 505, 506]
      }
    },
    "504": {
      "id": 504,
      "crossFilters": {
        "scope": {"rootPath": ["ROOT_ID"], "excluded": [504]},
        "chartsInScope": [501, 502, 504, 505, 506]
      }
    },
    "505": {
      "id": 505,
      "crossFilters": {
        "scope": {"rootPath": [], "excluded": [505]},
        "chartsInScope": []
      }
    },
    "506": {
      "id": 506,
      "crossFilters": {
        "scope": {"rootPath": [], "excluded": [506]},
        "chartsInScope": []
      }
    }
  }

@ShaliniIruvuru
Copy link

facing the same problem while import from v1.5.0 to v2.1.0. Also there is a notice appear everytime accessing to the imported dashboard: Error loading chart datasources. Filters may not work correctly. Although I have changed the scope as it is as the old dashboard and it work just fine as the old one. This notice confuse users and annoyin.

I have checked with import a dashboard from v1.5.0 to v2.1.0.It is working as expected.I didn't see all the filters are automatically applied to all the charts.

@LeoDiep
Copy link

LeoDiep commented Jun 19, 2023

facing the same problem while import from v1.5.0 to v2.1.0. Also there is a notice appear everytime accessing to the imported dashboard: Error loading chart datasources. Filters may not work correctly. Although I have changed the scope as it is as the old dashboard and it work just fine as the old one. This notice confuse users and annoyin.

I have checked with import a dashboard from v1.5.0 to v2.1.0.It is working as expected.I didn't see all the filters are automatically applied to all the charts.

My v.1.5.0 was built from scratch, and v.2.1.0 was deploy from docker, don't know is it because of this so I got the annoying notification and filters apply all charts

@chandrasekharjandhyam
Copy link

This issue still exists in 3.0.0 also, we are facing same issue. not able to export and import. this feature is non usable now.

@rusackas
Copy link
Member

I assume this still happens in 3.1/4.0, but if anyone can confirm or deny it, it would be appreciated, since we officially no longer support 3.0 or prior.

@rusackas rusackas added the validation:required A committer should validate the issue label Apr 23, 2024
@ferschubert
Copy link

Still happening with 4.0.2. We have a dev and prod setup and changes done in dev are exported -> imported into prod but all cross filter is lost which forces manual changes. As we are growing to 50+ dashboards things got out of control and we cannot proceed doing it manually.

@Daence96
Copy link

Daence96 commented Oct 8, 2024

We need to migrate more than 200 dashboards and it is essential to have this functionality to ensure the correct transition. We are currently working with version 4.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report validation:required A committer should validate the issue
Projects
None yet
Development

No branches or pull requests

10 participants