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

Can't use segments in case function for custom columns value #24922

Closed
selul opened this issue Aug 22, 2022 · 1 comment · Fixed by #24939
Closed

Can't use segments in case function for custom columns value #24922

selul opened this issue Aug 22, 2022 · 1 comment · Fixed by #24939
Assignees
Labels
Administration/Metrics & Segments .Frontend Priority:P2 Average run of the mill bug Querying/Notebook/Custom Column .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

@selul
Copy link

selul commented Aug 22, 2022

Describe the bug
Hi there,

I have a custom column created with an older version of Metabase using a case function. After upgrading it seems like if I try to edit it normalizes the value to some invalid format and I can no longer query the data.

This is the value that it works -> https://vertis.d.pr/ouisBv

Once I edit something, it gets transformed into https://vertis.d.pr/lnwzfe which is invalid, giving this error https://vertis.d.pr/6uox2m

I have to mention that all values are Segment names, not columns.

Logs

Input to resolve-card-id-source-tables* does not match schema: �[0;33m [(named {:query {:expressions {"Revenue Category" (named [nil (named [[(named (named [nil (named [(named (not (= :value :segment)) :value) nil (not (present? "type-info"))] "field") nil] "Must be a valid instance of one of these clauses: :and, :or, :not, :<, :<=, :>, :>=, :=, :!=") "pred") nil] [(named (named [nil (named [(named (not (= :value :segment)) :value) nil (not (present? "type-info"))] "field") nil] "Must be a valid instance of one of these clauses: :and, :or, :not, :<, :<=, :>, :>=, :=, :!=") "pred") nil] [(named (named [nil (named [(named (not (= :value :segment)) :value) nil (not (present? "type-info"))] "field") nil] "Must be a valid instance of one of these clauses: :and, :or, :not, :<, :<=, :>, :>=, :=, :!=") "pred") nil] [(named (named [nil (named [(named (not (= :value :segment)) :value) nil (not (present? "type-info"))] "field") nil] "Must be a valid instance of one of these clauses: :and, :or, :not, :<, :<=, :>, :>=, :=, :!=") "pred") nil] [(named (named [nil (named [(named (not (= :value :segment)) :value) nil (not (present? "type-info"))] "field") nil] "Must be a valid instance of one of these clauses: :and, :or, :not, :<, :<=, :>, :>=, :=, :!=") "pred") nil] [(named (named [nil (named [(named (not (= :value :segment)) :value) nil (not (present? "type-info"))] "field") nil] "Must be a valid instance of one of these clauses: :and, :or, :not, :<, :<=, :>, :>=, :=, :!=") "pred") nil] [(named (named [nil (named [(named (not (= :value :segment)) :value) nil (not (present? "type-info"))] "field") nil] "Must be a valid instance of one of these clauses: :and, :or, :not, :<, :<=, :>, :>=, :=, :!=") "pred") nil] [(named (named [nil (named [(named (not (= :value :segment)) :value) nil (not (present? "type-info"))] "field") nil] "Must be a valid instance of one of these clauses: :and, :or, :not, :<, :<=, :>, :>=, :=, :!=") "pred") nil] [(named (named [nil (named [(named (not (= :value :segment)) :value) nil (not (present? "type-info"))] "field") nil] "Must be a valid instance of one of these clauses: :and, :or, :not, :<, :<=, :>, :>=, :=, :!=") "pred") nil] [(named (named [nil (named [(named (not (= :value :segment)) :value) nil (not (present? "type-info"))] "field") nil] "Must be a valid instance of one of these clauses: :and, :or, :not, :<, :<=, :>, :>=, :=, :!=") "pred") nil] [(named (named [nil (named [(named (not (= :value :segment)) :value) nil (not (present? "type-info"))] "field") nil] "Must be a valid instance of one of these clauses: :and, :or, :not, :<, :<=, :>, :>=, :=, :!=") "pred") nil] [(named (named [nil (named [(named (not (= :value :segment)) :value) nil (not (present? "type-info"))] "field") nil] "Must be a valid instance of one of these clauses: :and, :or, :not, :<, :<=, :>, :>=, :=, :!=") "pred") nil] [(named (named [nil (named [(named (not (= :value :segment)) :value) nil (not (present? "type-info"))] "field") nil] "Must be a valid instance of one of these clauses: :and, :or, :not, :<, :<=, :>, :>=, :=, :!=") "pred") nil]] "clauses") nil] "Must be a valid instance of one of these clauses: :+, :-, :/, :*, :coalesce, :length, :floor, :ceil, :round, :abs, :power, :sqrt, :exp, :log, :case")}}} arg0)] �[0m

To Reproduce
Steps to reproduce the behavior:

  1. Go and create one segment
  2. Start a question and add a custom column
  3. use a case switch for that column values, i.e = case([Segment name],'Segment','Others')
  4. There is some normalization which is happening it gets turned into case([Segment name] = True,'Segment','Others') which breaks the query.

Expected behavior
The normalization should not break the query.

Screenshots

Information about your Metabase Installation:

You can get this information by going to Admin -> Troubleshooting.

Severity
The bug is blocking me from editing any query which uses segments in custom columns.

@selul selul added .Needs Triage Type:Bug Product defects labels Aug 22, 2022
@flamber flamber added Priority:P2 Average run of the mill bug Administration/Metrics & Segments .Frontend .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. Querying/Notebook/Custom Column and removed .Needs Triage labels Aug 22, 2022
@flamber
Copy link
Contributor

flamber commented Aug 22, 2022

Regression since 0.43.0, likely by #21342

@ranquild ranquild self-assigned this Aug 23, 2022
@ranquild ranquild added the .Reproduced Issues reproduced in test (usually Cypress) label Aug 23, 2022
@ranquild ranquild added this to the 0.44.2 milestone Aug 24, 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
Administration/Metrics & Segments .Frontend Priority:P2 Average run of the mill bug Querying/Notebook/Custom Column .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.

3 participants