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

Cannot convert SQL question with Snippet to Model #20963

Closed
flamber opened this issue Mar 11, 2022 · 5 comments · Fixed by #21210
Closed

Cannot convert SQL question with Snippet to Model #20963

flamber opened this issue Mar 11, 2022 · 5 comments · Fixed by #21210
Assignees
Labels
.Frontend Priority:P2 Average run of the mill bug Querying/Models aka Datasets Querying/Parameters & Variables Filter widgets, field filters, variables etc. .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

@flamber
Copy link
Contributor

flamber commented Mar 11, 2022

Describe the bug
Cannot convert SQL question with Snippet to Model

Workaround - remove the snippets, save the question, then convert to Model, then edit the query definition and add the snippets.

To Reproduce

  1. Native > Sample > Snippets sidebar, create a snippet like 'test' and add it to the editor, so the query is something like this:
    select {{snippet: String 'test'}}
    image
  2. Save question and try to convert to Model - is being blocked by the message Variables in models aren't supported yet, and says that snippets are allowed
    image

Information about your Metabase Installation:
Tested 0.42.0 thru 0.42.2

@flamber flamber added Type:Bug Product defects Priority:P2 Average run of the mill bug Querying/Parameters & Variables Filter widgets, field filters, variables etc. .Frontend .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. Querying/Models aka Datasets labels Mar 11, 2022
@matdgz
Copy link

matdgz commented Mar 11, 2022

Hey,
Actually it works sometimes, even with snippets. But I cannot say when it works and when it does not.

@WiNloSt
Copy link
Member

WiNloSt commented Mar 23, 2022

@flamber I forgot what's the solution we want for this? Is it that

  1. We allow converting questions with static snippets (no variables) to models or
  2. We change the error message to reflect that we don't allow snippets when converting to models

But based on the workaround you described

Workaround - remove the snippets, save the question, then convert to Model, then edit the query definition and add the snippets.

I assume it's 1. As the end result of the workaround is like allowing creating a model with static snippets.

@flamber
Copy link
Contributor Author

flamber commented Mar 23, 2022

@WiNloSt Yes, if it is technically possible to use Snippets on Models, then we should allow that. If there are problems (aka technical limitations like with Variables), then change the error message.

WiNloSt added a commit that referenced this issue Mar 24, 2022
WiNloSt added a commit that referenced this issue Mar 25, 2022
WiNloSt added a commit that referenced this issue Mar 25, 2022
* Add repro for #20963

* Fix cannot convert question with snippets to models
github-actions bot pushed a commit that referenced this issue Mar 25, 2022
* Add repro for #20963

* Fix cannot convert question with snippets to models
@flamber flamber added this to the 0.42.4 milestone Mar 25, 2022
@WiNloSt WiNloSt added the .Reproduced Issues reproduced in test (usually Cypress) label Mar 29, 2022
WiNloSt added a commit that referenced this issue Mar 30, 2022
* Add repro for #20963

* Fix cannot convert question with snippets to models

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <mahatthana.n@gmail.com>
@nemanjaglumac nemanjaglumac removed this from Backlog in Cypress Testing Apr 18, 2022
@amorrissey-veho
Copy link

I am getting this error when I am not using snippets. Is there another thread on that issue somewhere?

@flamber
Copy link
Contributor Author

flamber commented Jun 20, 2022

@amorrissey-veho If you aren't using snippets, then you are likely using other variables. Please use the forum for questions and troubleshooting: https://discourse.metabase.com/

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/Models aka Datasets Querying/Parameters & Variables Filter widgets, field filters, variables etc. .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
None yet
Development

Successfully merging a pull request may close this issue.

4 participants