Skip to content

Commit 8b22686

Browse files
committed
[NEP-18619]: Fetching unique filter dataset ids
1 parent 77dfa3b commit 8b22686

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/superset/dashboard/datasets/list.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def datasets_details
5151
private
5252

5353
def filter_dataset_ids
54-
@filter_dataset_ids ||= dashboard.filter_configuration.map { |c| c['targets'] }.flatten.compact.map { |c| c['datasetId'] }.flatten.compact
54+
@filter_dataset_ids ||= dashboard.filter_configuration.map { |c| c['targets'] }.flatten.compact.map { |c| c['datasetId'] }.flatten.compact.uniq
5555
end
5656

5757
def filter_datasets(filter_dataset_ids_not_used_in_charts)

lib/superset/services/duplicate_dashboard.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def source_dashboard_dataset_ids
259259
end
260260

261261
def source_dashboard_filter_dataset_ids
262-
@filter_dataset_ids ||= source_dashboard.filter_configuration.map { |c| c['targets'] }.flatten.compact.map { |c| c['datasetId'] }.flatten.compact
262+
@filter_dataset_ids ||= source_dashboard.filter_configuration.map { |c| c['targets'] }.flatten.compact.map { |c| c['datasetId'] }.flatten.compact.uniq
263263
end
264264

265265
# Primary Assumption is that all charts datasets on the source dashboard are pointing to the same database schema

0 commit comments

Comments
 (0)