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

Visualization type is not always respected, when filters are applied #17524

Closed
flamber opened this issue Aug 20, 2021 · 0 comments · Fixed by #17860
Closed

Visualization type is not always respected, when filters are applied #17524

flamber opened this issue Aug 20, 2021 · 0 comments · Fixed by #17860
Assignees
Labels
.Frontend Priority:P2 Average run of the mill bug .Reproduced Issues reproduced in test (usually Cypress) Type:Bug Product defects Visualization/
Milestone

Comments

@flamber
Copy link
Contributor

flamber commented Aug 20, 2021

Describe the bug
When a question is saved with a specific visualization type, then applying filters can sometimes change the visualization type.

Reproduce 1

  1. Native query > Sample Dataset - variable {{num}} as Number
select * from (
    select 'A' step, 41 users, 42 median union all
    select 'B' step, 31 users, 32 median union all
    select 'C' step, 21 users, 22 median union all
    select 'D' step, 11 users, 12 median
) x
[[where users>{{num}}]]
  1. Change visualization type to Funnel and save question
    image
  2. Browser refresh and see that it shows as a funnel, and then input 1 into the filter widget - it now changes to Table visualization and the question becomes "dirty" with the Save-button active
    image

Reproduce 2

  1. Custom question > Sample Dataset > Products - Count and Sum of Price grouped by Category
  2. Change visualization to Funnel and save question
    image
  3. Browser refresh and see that it shows as funnel, and then filter by ID > 0 - it now changes to Bar visualization.
    Looking at the URL hash, it contains "display":"funnel","displayIsLocked":true but that's not being respected.
    image

Expected behavior
The auto-viz logic can be tricky, but if the column structure of results doesn't change, then the viz selection should be respected.
It should be the sweet spot between lax and aggressive, which historically has been difficult to get correct (see PR #12476)

Information about your Metabase Installation:
Tested 0.40.2

Additional context
Likely very related to #16334

@flamber flamber added Type:Bug Product defects Priority:P2 Average run of the mill bug Visualization/ .Frontend labels Aug 20, 2021
@nemanjaglumac nemanjaglumac added this to Backlog in Cypress Testing Aug 20, 2021
nemanjaglumac added a commit that referenced this issue Aug 23, 2021
nemanjaglumac added a commit that referenced this issue Aug 24, 2021
@nemanjaglumac nemanjaglumac added the .Reproduced Issues reproduced in test (usually Cypress) label Aug 24, 2021
@flamber flamber added this to the 0.41 milestone Sep 15, 2021
This was referenced Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Frontend Priority:P2 Average run of the mill bug .Reproduced Issues reproduced in test (usually Cypress) Type:Bug Product defects Visualization/
Projects
Development

Successfully merging a pull request may close this issue.

3 participants