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 dashboard panels distinct functions #11580

Merged
merged 1 commit into from
Feb 16, 2022
Merged

Fix dashboard panels distinct functions #11580

merged 1 commit into from
Feb 16, 2022

Conversation

azrikahar
Copy link
Contributor

@azrikahar azrikahar commented Feb 11, 2022

Fixes #11574

Context

When we select Count (Distinct) aggregate function for applicable panels, the value is sent as count_distinct (snake_case):

text: 'Count (Distinct)',
value: 'count_distinct',

However the API expects countDistinct (camelCase):

if (operation === 'countDistinct') {
dbQuery.countDistinct(`${collection}.${field}`, { as: `countDistinct->${field}` });
}

Before

It should show aggregate functiosn on two numbers, 20 and 30. 3rd number is not distinct, hence it should be omitted. But since the functions are the wrong case, they were never applied and the API returns empty result (blank UI).

chrome_GB3TGleGRN

After

chrome_S4aOXlIN8Y

@azrikahar azrikahar self-assigned this Feb 11, 2022
@azrikahar azrikahar changed the title Fix dashboard panels disctinct functions Fix dashboard panels distinct functions Feb 11, 2022
@rijkvanzanten rijkvanzanten added this to the v9-next milestone Feb 16, 2022
@rijkvanzanten rijkvanzanten merged commit 8b22efe into main Feb 16, 2022
@rijkvanzanten rijkvanzanten deleted the issue/11574 branch February 16, 2022 14:29
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

countDistinct is going as count_distinct in Insights section - Metric
2 participants