Skip to content
Snippets Groups Projects
Unverified Commit 007c5353 authored by Ariya Hidayat's avatar Ariya Hidayat Committed by GitHub
Browse files

Correct the arguments for PERCENTILE function (#15724)

This fixes #15714
parent 05b4011f
No related branches found
No related tags found
No related merge requests found
......@@ -117,7 +117,7 @@ export const MBQL_CLAUSES = {
percentile: {
displayName: `Percentile`,
type: "aggregation",
args: ["number"],
args: ["number", "number"],
requiresFeature: "percentile-aggregations",
},
// string functions
......
......@@ -76,7 +76,7 @@ describe("postgres > question > custom columns", () => {
});
});
it.skip("`Percentile` custom expression function should accept two parameters (metabase#15714)", () => {
it("`Percentile` custom expression function should accept two parameters (metabase#15714)", () => {
cy.visit("/question/new");
cy.findByText("Custom question").click();
cy.findByText(PG_DB_NAME).click();
......
......@@ -110,6 +110,10 @@ describe("type-checker", () => {
it("should accept a CASE expression with complex arguments", () => {
expect(() => validate("CASE(Deal, 0.5*X, Y-Z)")).not.toThrow();
});
it("should accept PERCENTILE with two arguments", () => {
expect(() => validate("PERCENTILE([Rating], .5)")).not.toThrow();
});
});
describe("for a filter", () => {
......
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