You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by va...@apache.org on 2025/07/08 05:01:12 UTC

(superset) branch fix/metric-d3format updated (f7a6add17e -> a2c5154f7e)

This is an automated email from the ASF dual-hosted git repository.

vavila pushed a change to branch fix/metric-d3format
in repository https://gitbox.apache.org/repos/asf/superset.git


 discard f7a6add17e fix: Apply metric d3format from dataset when currency config is {}
     new a2c5154f7e fix: Apply metric d3format from dataset when currency config is {}

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (f7a6add17e)
            \
             N -- N -- N   refs/heads/fix/metric-d3format (a2c5154f7e)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../superset-ui-core/test/currency-format/utils.test.ts    | 14 ++++++++++++++
 1 file changed, 14 insertions(+)


(superset) 01/01: fix: Apply metric d3format from dataset when currency config is {}

Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vavila pushed a commit to branch fix/metric-d3format
in repository https://gitbox.apache.org/repos/asf/superset.git

commit a2c5154f7e8565df10ae60a9e9f307931e4ef3d0
Author: Vitor Avila <vi...@preset.io>
AuthorDate: Tue Jul 8 01:44:07 2025 -0300

    fix: Apply metric d3format from dataset when currency config is {}
---
 .../packages/superset-ui-core/src/currency-format/utils.ts |  2 +-
 .../superset-ui-core/test/currency-format/utils.test.ts    | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/superset-frontend/packages/superset-ui-core/src/currency-format/utils.ts b/superset-frontend/packages/superset-ui-core/src/currency-format/utils.ts
index 243aa92a9f..14228ea77f 100644
--- a/superset-frontend/packages/superset-ui-core/src/currency-format/utils.ts
+++ b/superset-frontend/packages/superset-ui-core/src/currency-format/utils.ts
@@ -40,7 +40,7 @@ export const buildCustomFormatters = (
       const actualCurrencyFormat = currencyFormat?.symbol
         ? currencyFormat
         : savedCurrencyFormats[metric];
-      return actualCurrencyFormat
+      return actualCurrencyFormat?.symbol
         ? {
             ...acc,
             [metric]: new CurrencyFormatter({
diff --git a/superset-frontend/packages/superset-ui-core/test/currency-format/utils.test.ts b/superset-frontend/packages/superset-ui-core/test/currency-format/utils.test.ts
index cb65528a89..37456873c0 100644
--- a/superset-frontend/packages/superset-ui-core/test/currency-format/utils.test.ts
+++ b/superset-frontend/packages/superset-ui-core/test/currency-format/utils.test.ts
@@ -19,6 +19,7 @@
 
 import {
   buildCustomFormatters,
+  Currency,
   CurrencyFormatter,
   getCustomFormatter,
   getNumberFormatter,
@@ -116,6 +117,19 @@ test('buildCustomFormatters uses dataset d3 format if not provided in control pa
   );
 });
 
+test('buildCustomFormatters uses dataset d3 format when currency config is empty', () => {
+  const customFormatters: Record<string, ValueFormatter> =
+    buildCustomFormatters(
+      ['count'],
+      { count: {} as Currency },
+      { count: ',.2%' },
+      undefined,
+      undefined,
+    );
+
+  expect(customFormatters.count).toBeInstanceOf(NumberFormatter);
+});
+
 test('getCustomFormatter', () => {
   const customFormatters = {
     sum__num: new CurrencyFormatter({