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

Dashboard subscription for auto generated dashboards is broken #38350

Closed
perivamsi opened this issue Feb 1, 2024 · 1 comment · Fixed by #38379
Closed

Dashboard subscription for auto generated dashboards is broken #38350

perivamsi opened this issue Feb 1, 2024 · 1 comment · Fixed by #38379
Assignees
Labels
Querying/X-rays .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. Reporting/Dashboards .Team/DashViz Dashboard and Viz team Type:Bug Product defects Visualization/Static Subscriptions/pulse generated image
Milestone

Comments

@perivamsi
Copy link
Contributor

Describe the bug

When you email a dashboard that is auto generated (using xrays), it does not work and you see "an error has occurred while displaying this card" for many of the cards.

Example dashboard where this fails: https://stats.metabase.com/dashboard/2241-a-look-at-accounts

Screenshot 2024-02-01 at 5 22 21 AM

To Reproduce

  1. Go to browse data > databases > sample database
  2. Click on "x-ray this table" for any table, say Accounts
  3. Save the generated dashboard
  4. Go to subscriptions > email > and email it to yourself.

Expected behavior

No response

Logs

No response

Information about your Metabase installation

stats

Severity

P2

Additional context

No response

@perivamsi perivamsi added Type:Bug Product defects .Needs Triage .Team/DashViz Dashboard and Viz team Visualization/Static Subscriptions/pulse generated image Querying/X-rays Reporting/Dashboards and removed .Needs Triage labels Feb 1, 2024
@qnkhuat qnkhuat added the .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. label Feb 1, 2024
@markbastian markbastian self-assigned this Feb 1, 2024
@markbastian
Copy link
Contributor

This ns will reproduce the issue:

(ns tickets.38350-broken-xray-export
  (:require
    [dev.render-png :as render-png]
    [metabase.models :refer [Card]]
    [metabase.test :as mt]
    [toucan2.core :as t2]))

;; Local state

;; Broken
(t2/select-one :model/Card 86)

;; Not broken
(t2/select-one :model/Card 92)

(let [{bad-dataset-query :dataset_query} (t2/select-one :model/Card 101)
      {good-dataset-query :dataset_query} (t2/select-one :model/Card 104)]
  [bad-dataset-query
   good-dataset-query])

(render-png/render-card-to-png 101)
(render-png/render-card-to-png 104)

;; Reproducible case
(mt/dataset test-data
  (mt/with-temp [Card {good-card-id :id}
                 {:display :row
                  :dataset_query {:database (mt/id)
                                  :type     :query
                                  :query    {:source-table (mt/id :orders)
                                             :aggregation  [[:count]]
                                             :breakout     [[:field
                                                             (mt/id :products :category)
                                                             {:source-field (mt/id :orders :product_id)}]]}}
                  :visualization_settings {:graph.series_labels [nil]
                                           :graph.dimensions [{:ProductCategoryMedium {}}]
                                           :graph.colors ["#EF8C8C"]
                                           :graph.metrics [nil]}}
                 Card {bad-card-id :id}
                 {:display :row
                  :dataset_query {:database (mt/id)
                                  :type     :query
                                  :query    {:source-table (mt/id :orders)
                                             :aggregation  [[:count]]
                                             :breakout     [[:field
                                                             (mt/id :products :category)
                                                             {:base-type :type/Text
                                                              :source-field (mt/id :orders :product_id)}]]}}
                  :visualization_settings {:graph.dimensions ["CATEGORY"]
                                           :graph.metrics ["count"]}}]
    (render-png/render-card-to-png good-card-id)
    (render-png/render-card-to-png bad-card-id)))

For a :row chart, the :graph.metrics and :graph.dimensions must be set correctly for static viz. The [{:ProductCategoryMedium {}}] looks like an issue from the x-ray code and the nil metric must be set to the correct value for a :row chart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Querying/X-rays .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. Reporting/Dashboards .Team/DashViz Dashboard and Viz team Type:Bug Product defects Visualization/Static Subscriptions/pulse generated image
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants