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

Error calculating display info on filtering with a model #36400

Closed
darksciencebase opened this issue Dec 5, 2023 — with Slack · 8 comments
Closed

Error calculating display info on filtering with a model #36400

darksciencebase opened this issue Dec 5, 2023 — with Slack · 8 comments
Assignees
Labels
.metabase-lib Label for tracking all issues related to the shared CLJC metabase-lib .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects
Milestone

Comments

Copy link
Contributor

darksciencebase commented Dec 5, 2023

This seems MBQL-related. In the repro I:

  1. Went to the model
  2. Filtered in chill mode (which works)
  3. Opened notebook mode
  4. Removed the filter
  5. Opened the filter UI again
  6. It broke

Slack Message (there's a loom of the repro in the thread)

n0.gi {message: "Error calculating display info for column-group: Cannot read properties of null (reading 'replace')", data: n0.h, cause: TypeError: Cannot read properties of null (reading 'replace')
    at a (https://stats.metabase.com/…, name: 'Error', description: undefined, …}
iJ @ react-dom.production.min.js:209
n.payload @ react-dom.production.min.js:227
oO @ react-dom.production.min.js:129
iI @ react-dom.production.min.js:179
l @ react-dom.production.min.js:263
aH @ react-dom.production.min.js:246
(anonymous) @ react-dom.production.min.js:246
aW @ react-dom.production.min.js:246
(anonymous) @ react-dom.production.min.js:123
t.unstable_runWithPriority @ scheduler.production.min.js:19
on @ react-dom.production.min.js:122
oi @ react-dom.production.min.js:123
oo @ react-dom.production.min.js:122
Y @ react-dom.production.min.js:287
tU @ react-dom.production.min.js:68
@darksciencebase darksciencebase added .metabase-lib Label for tracking all issues related to the shared CLJC metabase-lib .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects labels Dec 5, 2023 — with Slack
@bshepherdson bshepherdson self-assigned this Jan 11, 2024
@bshepherdson
Copy link
Contributor

I'll take a look at this. It sounds like it might be the same cause as #37067, which has a fixed out for review #37536. Once that is in stats it'll be easy to try again to repro it.

@bshepherdson
Copy link
Contributor

Actually I can't reproduce this.

Looking more closely at the steps and outcome, I suspect that this was fixed by removing empty stages (#37311). With a SQL model, creating the filter adds a new stage, and then removing the filter empties the stage. Then I guess something broke when trying to open the Filters UI again.

Closing as no repro.

@darksciencebase
Copy link
Contributor Author

i've just reproduced it on stats following the steps from Bruno's loom. i had to try twice though — it was fine when i was adding/removing a filter on the 'change type' column, but it broke with a filter on 'plan name'.

@bshepherdson
Copy link
Contributor

Ah, I can repro this. I'm looking into it.

@bshepherdson
Copy link
Contributor

The immediate error is coming from trying to regex-match against the :display-name of a field, but it's nil rather than a string. The :display-name is nil I think because we don't have the target field in the metadata yet.

The columns for which it fails are mapped in from another table, and I guess if you land directly on the model and start adding and removing filters it might not have the metadata yet. I'm still investigating. We can certainly fix the code to be more robust against nils here, but it would still be displaying the filterable columns badly.

I'm still debugging and trying to find the root problem, whether metadata or otherwise.

@bshepherdson
Copy link
Contributor

Digging in makes it look like this might also be solved by fixing how implicit joins are handled with SQL models, see #37536 .

@bshepherdson
Copy link
Contributor

#37536 is submitted; I'll check this tomorrow to see if it's fixed on stats.

bshepherdson added a commit that referenced this issue Jan 16, 2024
Models can override the `:id` and `:fk-target-field-id` of a column, and
can even lie and treat a quantity as a FK. Therefore we have to use the
query's view of the column and not the global field from the metadata.

This is a speculative fix for #36400, which I can't reproduce locally.
bshepherdson added a commit that referenced this issue Jan 17, 2024
Models can override the `:id` and `:fk-target-field-id` of a column, and
can even lie and treat a quantity as a FK. Therefore we have to use the
query's view of the column and not the global field from the metadata.

This is a speculative fix for #36400, which I can't reproduce locally.
bshepherdson added a commit that referenced this issue Jan 18, 2024
Models can override the `:id` and `:fk-target-field-id` of a column, and
can even lie and treat a quantity as a FK. Therefore we have to use the
query's view of the column and not the global field from the metadata.

This is a speculative fix for #36400, which I can't reproduce locally.
@bshepherdson
Copy link
Contributor

This was fixed by #37771.

@bshepherdson bshepherdson added this to the 0.49 milestone Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.metabase-lib Label for tracking all issues related to the shared CLJC metabase-lib .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects
Projects
None yet
Development

No branches or pull requests

2 participants