Skip to content
Snippets Groups Projects
Unverified Commit b88f8e63 authored by Dalton's avatar Dalton Committed by GitHub
Browse files

use is-null filter when value is null (#16601)

parent cd33b54a
No related branches found
No related tags found
No related merge requests found
......@@ -152,8 +152,10 @@ export function drillFilter(
const range = rangeForValue(value, column);
if (range) {
filter = ["between", fieldRefForColumn(column), range[0], range[1]];
} else {
} else if (value != null) {
filter = ["=", fieldRefForColumn(column), value];
} else {
filter = ["is-null", fieldRefForColumn(column)];
}
}
......
......@@ -414,6 +414,35 @@ describe("scenarios > visualizations > drillthroughs > chart drill", () => {
cy.findByText("Showing 85 rows");
});
it("should drill through on a bin of null values (#11345)", () => {
visitQuestionAdhoc({
name: "11345",
dataset_query: {
database: 1,
query: {
"source-table": ORDERS_ID,
aggregation: [["count"]],
breakout: [
["field", ORDERS.DISCOUNT, { binning: { strategy: "default" } }],
],
},
type: "query",
},
display: "table",
});
// click on the Count column cell showing the count of null rows
cy.findByText("16,845").click();
cy.findByText("View these Orders").click();
// count number of distinct values in the Discount column
cy.findByText("Discount ($)").click();
cy.findByText("Distincts").click();
// there should be 0 distinct values since they are all null
cy.get(".TableInteractive-cellWrapper").contains("0");
});
it("should parse value on click through on the first row of pie chart (metabase#15250)", () => {
cy.createQuestion({
name: "15250",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment