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

Ensure consistent percentage formatting across FE and pulses #36327

Closed
Tracked by #36015
markbastian opened this issue Dec 1, 2023 · 1 comment
Closed
Tracked by #36015

Ensure consistent percentage formatting across FE and pulses #36327

markbastian opened this issue Dec 1, 2023 · 1 comment
Assignees
Labels
.Backend no-backport Do not backport this PR to any branch .Team/DashViz Dashboard and Viz team
Milestone

Comments

@markbastian
Copy link
Contributor

markbastian commented Dec 1, 2023

Dashboard rendering of percent columns and the html export produced when emailing a pulse do not use the same number of significant digits. In the example below, the dashboard shows 2 digits after the decimal point and the pulse html rounds to the nearest integer.

To reproduce:

  • Create a model and edit the user metadata on a column with values in the range of [0, 100] as :type/Percentage.
  • Create a question based on that model.
  • Add both items to a dashboard.
  • Email the dashboard.
  • View the email body.

You should see the values represented with different precision.

The following animation demonstrates the problem behavior.

formatting

The unit test metabase.pulse.pulse-integration-test/result-metadata-preservation-in-html-static-viz-test is a good basis to set up a unit test for this behavior.

AC:

  • A unit test that computes both the in-app rendered value and the and the exported HTML value.
  • These values should be the same.
  • If the in-app values are determined on the FE, perhaps manually set the expected values to what is on the FE.
@markbastian markbastian added no-backport Do not backport this PR to any branch .Team/DashViz Dashboard and Viz team .Backend labels Dec 1, 2023
@markbastian markbastian changed the title Ensure consistent formatting across FE and pulses Ensure consistent percentage formatting across FE and pulses Dec 1, 2023
@markbastian markbastian self-assigned this Dec 5, 2023
@markbastian
Copy link
Contributor Author

Fixed by #36431

@markbastian markbastian modified the milestones: 0.48.3, 0.49 Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Backend no-backport Do not backport this PR to any branch .Team/DashViz Dashboard and Viz team
Projects
None yet
Development

No branches or pull requests

1 participant