From 90afb34df59e818731921ec86dd708e13ce9187e Mon Sep 17 00:00:00 2001 From: Pat Nadolny Date: Thu, 21 Mar 2024 17:06:15 -0500 Subject: [PATCH] fix: Volatile datasource ordering in dashboard export (#19595) Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com> (cherry picked from commit bfe55b9ded5d7efdcb7919d70d5dc14c97126afd) --- superset/models/dashboard.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/superset/models/dashboard.py b/superset/models/dashboard.py index 5570e892ff..0a0d789c7a 100644 --- a/superset/models/dashboard.py +++ b/superset/models/dashboard.py @@ -365,8 +365,11 @@ class Dashboard(AuditMixinNullable, ImportExportMixin, Model): copied_dashboard.alter_params(remote_id=dashboard_id) copied_dashboards.append(copied_dashboard) + datasource_id_list = list(datasource_ids) + datasource_id_list.sort() + eager_datasources = [] - for datasource_id, _ in datasource_ids: + for datasource_id, _ in datasource_id_list: eager_datasource = SqlaTable.get_eager_sqlatable_datasource(datasource_id) copied_datasource = eager_datasource.copy() copied_datasource.alter_params(