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

Removing a custom column used in the grouping crashes the query builder #32625

Closed
ngapuileung opened this issue Jul 25, 2023 · 1 comment · Fixed by #32685 or #32850
Closed

Removing a custom column used in the grouping crashes the query builder #32625

ngapuileung opened this issue Jul 25, 2023 · 1 comment · Fixed by #32685 or #32850
Assignees
Labels
.Frontend Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness .Regression/master Regression that is only present on master, or bug in new upcoming feature .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects

Comments

@ngapuileung
Copy link

ngapuileung commented Jul 25, 2023

Describe the bug

The query builder crashes when I remove a custom column from an existing question. That custom column is neither displayed nor used for sorting in the output/results but is used in the grouping.

To Reproduce

  1. Create a new question using the Orders sample table
  2. Add a custom column called "Is Promotion": case([Discount] > 0, 1, 0)
  3. Group by the custom column and count the number of distinct order IDs
  4. Remove the custom column
  5. Query builder crashes
Screenshot 2023-07-25 at 6 19 35 PM

Expected behavior

The custom column should just be dropped and the question should not group by the removed column anymore.

Logs

Screenshot 2023-07-25 at 6 19 18 PM

Information about your Metabase installation

{
  "browser-info": {
    "language": "en-GB",
    "platform": "MacIntel",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.19+7",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "11.0.19",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.19+7",
    "os.name": "Linux",
    "os.version": "5.10.184-175.731.amzn2.x86_64",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "druid",
      "redshift",
      "mysql",
      "bigquery-cloud-sdk",
      "postgres",
      "mongo",
      "h2"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "14.7"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.5.4"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2023-07-25",
      "tag": "vUNKNOWN",
      "branch": "master",
      "hash": "14a24c5"
    },
    "settings": {
      "report-timezone": "US/Pacific"
    }
  }
}

Severity

Annoying but there is a workaround by removing the grouping first

Additional context

No response

@ngapuileung ngapuileung changed the title Removing a custom column from an existing question crashes the query builder Removing a custom column used in the grouping crashes the query builder Jul 25, 2023
@darksciencebase darksciencebase added the .Team/QueryProcessor :hammer_and_wrench: label Jul 25, 2023
@paoliniluis paoliniluis added .Frontend .Regression/master Regression that is only present on master, or bug in new upcoming feature Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness and removed .Needs Triage .Team/QueryProcessor :hammer_and_wrench: labels Jul 25, 2023
@darksciencebase darksciencebase added the .Team/QueryProcessor :hammer_and_wrench: label Jul 25, 2023
metamben added a commit that referenced this issue Jul 28, 2023
…2685)

* Remove references to missing expressions when converting to pMBQL

Fixes #32625,
oisincoveney pushed a commit that referenced this issue Jul 31, 2023
…2685)

* Remove references to missing expressions when converting to pMBQL

Fixes #32625,
@darksciencebase
Copy link
Contributor

image
Now I'm seeing this on stats. QB did not crash after I removed the custom column, so I clicked 'Visualize' and got an error that is talking about the custom column which is not there anymore (I used a custom column =1+1 named 2.
@ngapuileung could you please also check if it works for you?

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:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness .Regression/master Regression that is only present on master, or bug in new upcoming feature .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects
Projects
None yet
5 participants