-
- Downloads
Adding Percent Metadata Type (#36145)
* Adding Percent Metadata Type
This adds the :type/Percentage metadata type to Metabase. It does
not currently do any fingerprinting. It just enables setting of the
type for the FE.
* Making :type/Percentage a semantic type as well as a decimal.
* support Percentage setting in the semantic type editor, infer percentage column formatting default
* Support for static-viz rendering when user metadata is `:type/Percentage`
This PR adds in user-defined metadata in `prep-for-html-rendering` so that `number-formatter` can properly render the column as a percentage. This may actually fix a family of issues as user-defined metadata doesn't appear to be used anywhere in this ns. We still need to consider cases where the formatting is specified by the viz settings, but this one step in the right direction.
* Percent semantic types render as percents in tables
This PR adds logic to properly capture a percent semantic type and renders it as such in a table static viz. Note that the `number-formatter` function in `metabase.pulse.render.common` has logic that renders the percent as a truncated int. IDK if this the desired long term behavior. I'll have to ask product that, but if we just make the change it could have potential impacts on places that expect this behavior. It seems like it would make more sense to be like Excel and allow each column to set its significant digits.
* Revert "support Percentage setting in the semantic type editor, infer percentage column formatting default"
This reverts commit e001e6312e6f0bd5700c1d9eb28c88829d87a70a.
---------
Co-authored-by:
Aleksandr Lesnenko <alxnddr@gmail.com>
Showing
- dev/src/dev/render_png.clj 37 additions, 27 deletionsdev/src/dev/render_png.clj
- src/metabase/pulse/render.clj 1 addition, 1 deletionsrc/metabase/pulse/render.clj
- src/metabase/pulse/render/body.clj 21 additions, 10 deletionssrc/metabase/pulse/render/body.clj
- src/metabase/pulse/render/common.clj 18 additions, 17 deletionssrc/metabase/pulse/render/common.clj
- src/metabase/types.cljc 5 additions, 0 deletionssrc/metabase/types.cljc
- test/metabase/pulse/render_test.clj 41 additions, 0 deletionstest/metabase/pulse/render_test.clj
- test/metabase/sync/analyze/fingerprint_test.clj 3 additions, 3 deletionstest/metabase/sync/analyze/fingerprint_test.clj
Please register or sign in to comment