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

Frontend crashes when using a custom column on a nested query #18814

Closed
paoliniluis opened this issue Nov 2, 2021 · 6 comments · Fixed by #20510
Closed

Frontend crashes when using a custom column on a nested query #18814

paoliniluis opened this issue Nov 2, 2021 · 6 comments · Fixed by #20510
Assignees
Labels
.Frontend Priority:P2 Average run of the mill bug Querying/Nested Queries Questions based on other saved questions Querying/Notebook Items specific to the Custom/Notebook query builder .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. .Reproduced Issues reproduced in test (usually Cypress) Type:Bug Product defects
Milestone

Comments

@paoliniluis
Copy link
Contributor

Describe the bug
When building a nested query with a custom column, the frontend crashes when doing a "group by" by this column on the second stage of the question

Logs
No logs on the backend, the frontend crashes with

Dimension.js:450 Unknown MBQL Field clause (2) ['expression', 'a-year-in_middlescores']

react-dom.production.min.js:209 TypeError: a.mbql is not a function

react-dom.production.min.js:50 Uncaught Error: Minified React error #188; visit https://reactjs.org/docs/error-decoder.html?invariant=188 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

To Reproduce

  1. With the orders table do a "Count" by "Created at: year"
  2. Build a custom column with the [Created At] field
  3. Now summarize again by "Count" and select the newly created custom column

Expected behavior
It should show the result, in fact the preview works correctly, but when you click in visualize it won't work

Screenshots
image
image

Information about your Metabase Installation:

  • Your browser and the version: Brave latest
  • Your operating system: Ubuntu 21.10
  • Your databases: sample dataset
  • Metabase version: 41.1
  • Metabase hosting environment: Docker
  • Metabase internal database: Postgres

Severity
How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Metabase entirely?
Note: the more honest and specific you are here the more we will take you seriously.

Additional context
Add any other context about the problem here.

@paoliniluis paoliniluis added Type:Bug Product defects Priority:P2 Average run of the mill bug Querying/Nested Queries Questions based on other saved questions Querying/Notebook Items specific to the Custom/Notebook query builder labels Nov 2, 2021
@flamber flamber added .Frontend .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. labels Nov 2, 2021
@flamber
Copy link
Contributor

flamber commented Nov 2, 2021

Regression since 0.40.0 - works on 0.39.5

@spectorar
Copy link

Is there a way to workaround this without downgrading to 0.39.5 (which makes me uncomfortable going from 0.41). We have a couple visualizations that are experiencing this issue. Is there a planned version for a fix? Thanks!

@paoliniluis
Copy link
Contributor Author

Is there a way to workaround this without downgrading to 0.39.5 (which makes me uncomfortable going from 0.41). We have a couple visualizations that are experiencing this issue. Is there a planned version for a fix? Thanks!

Not currently. I would suggest you do a native sql question instead of downgrading which could cause very unexpected consequences

@spectorar
Copy link

Given this is a frontend issue (since the query does actually return data), will a native query still work?

@flamber
Copy link
Contributor

flamber commented Jan 20, 2022

@spectorar Yes, since the problem comes from the Notebooks handling of the field references, which doesn't exist in SQL.

@ariya
Copy link
Contributor

ariya commented Feb 14, 2022

The error thrown by the front-end, because our TimeseriesFilterWidget does not take into account that the filtered dimension can be of an expression (i.e. due to the custom column), and not just a vanilla field from the table.

image

Next step: teach TimeseriesFilterWidget to generalize the filter dimension, for both field and expression.

@ariya ariya linked a pull request Feb 14, 2022 that will close this issue
@flamber flamber added this to the 0.43 milestone Feb 17, 2022
@nemanjaglumac nemanjaglumac added this to Backlog in Cypress Testing Feb 18, 2022
nemanjaglumac added a commit that referenced this issue Feb 21, 2022
nemanjaglumac added a commit that referenced this issue Feb 21, 2022
@nemanjaglumac nemanjaglumac added the .Reproduced Issues reproduced in test (usually Cypress) label Feb 21, 2022
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 Querying/Nested Queries Questions based on other saved questions Querying/Notebook Items specific to the Custom/Notebook query builder .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. .Reproduced Issues reproduced in test (usually Cypress) Type:Bug Product defects
Projects
Development

Successfully merging a pull request may close this issue.

5 participants