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

Fix #19141: Data Insight Tier Filter does not work #19142

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.io.IOException;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.openmetadata.schema.dataInsight.custom.DataInsightCustomChart;
Expand Down Expand Up @@ -87,7 +88,13 @@ public DataInsightCustomChartResultList getPreviewData(
DataInsightCustomChart chart, long startTimestamp, long endTimestamp, String filter)
throws IOException {
if (chart.getChartDetails() != null && filter != null) {
((LinkedHashMap<String, Object>) chart.getChartDetails()).put("filter", filter);
HashMap chartDetails = (LinkedHashMap<String, Object>) chart.getChartDetails();
if (chartDetails.get("metrics") != null) {
for (LinkedHashMap<String, Object> metrics :
(List<LinkedHashMap<String, Object>>) chartDetails.get("metrics")) {
metrics.put("filter ", filter);
}
}
}
return getPreviewData(chart, startTimestamp, endTimestamp);
}
Expand All @@ -110,7 +117,13 @@ public Map<String, DataInsightCustomChartResultList> listChartData(

if (chart != null) {
if (chart.getChartDetails() != null && filter != null) {
((LinkedHashMap<String, Object>) chart.getChartDetails()).put("filter", filter);
HashMap chartDetails = (LinkedHashMap<String, Object>) chart.getChartDetails();
if (chartDetails.get("metrics") != null) {
for (LinkedHashMap<String, Object> metrics :
(List<LinkedHashMap<String, Object>>) chartDetails.get("metrics")) {
metrics.put("filter ", filter);
}
}
}
DataInsightCustomChartResultList data =
searchClient.buildDIChart(chart, startTimestamp, endTimestamp);
Expand Down
Loading