You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ha...@apache.org on 2026/03/26 14:45:32 UTC

(superset) branch fix/not-displaying-undefined-filter-val-for-chart-change-record created (now 44502859a38)

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

hainenber pushed a change to branch fix/not-displaying-undefined-filter-val-for-chart-change-record
in repository https://gitbox.apache.org/repos/asf/superset.git


      at 44502859a38 fix(AlteredSliceTag): not display undefined filter value for chart change record

This branch includes the following new commits:

     new 44502859a38 fix(AlteredSliceTag): not display undefined filter value for chart change record

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.



(superset) 01/01: fix(AlteredSliceTag): not display undefined filter value for chart change record

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

hainenber pushed a commit to branch fix/not-displaying-undefined-filter-val-for-chart-change-record
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 44502859a38348696b7bec009164d56347325400
Author: hainenber <do...@gmail.com>
AuthorDate: Thu Mar 26 21:45:11 2026 +0700

    fix(AlteredSliceTag): not display undefined filter value for chart change record
    
    Signed-off-by: hainenber <do...@gmail.com>
---
 .../src/components/AlteredSliceTag/utils/index.ts  |  2 +-
 .../components/AlteredSliceTag/utils/utils.test.ts | 27 ++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/superset-frontend/src/components/AlteredSliceTag/utils/index.ts b/superset-frontend/src/components/AlteredSliceTag/utils/index.ts
index 482a4332621..9fa9830e785 100644
--- a/superset-frontend/src/components/AlteredSliceTag/utils/index.ts
+++ b/superset-frontend/src/components/AlteredSliceTag/utils/index.ts
@@ -52,7 +52,7 @@ export const formatValueHandler = (
           v.comparator && v.comparator.constructor === Array
             ? `[${v.comparator.join(', ')}]`
             : v.comparator;
-        return `${v.subject} ${v.operator} ${filterVal}`;
+        return filterVal ? `${v.subject} ${v.operator} ${filterVal}` : `${v.subject} ${v.operator}`;
       })
       .join(', ');
   }
diff --git a/superset-frontend/src/components/AlteredSliceTag/utils/utils.test.ts b/superset-frontend/src/components/AlteredSliceTag/utils/utils.test.ts
index feddddeb0a1..1ceee92c589 100644
--- a/superset-frontend/src/components/AlteredSliceTag/utils/utils.test.ts
+++ b/superset-frontend/src/components/AlteredSliceTag/utils/utils.test.ts
@@ -258,6 +258,33 @@ describe('formatValueHandler', () => {
 
     expect(result).toEqual(expected);
   });
+
+  test('formats unary filter', () => {
+    const filters = [
+      {
+        expressionType: 'SIMPLE',
+        operator: 'IS NULL',
+        subject: 'a',
+      },
+      {
+        clause: 'WHERE',
+        comparator: ['hu', 'ho', 'ha'],
+        expressionType: 'SIMPLE',
+        operator: 'NOT IN',
+        subject: 'b',
+      },
+    ];
+    const key = 'adhoc_filters';
+
+    const expected = 'a IS NULL, b NOT IN [hu, ho, ha]';
+    const formattedValue: string | number = formatValueHandler(
+      filters,
+      key,
+      controlsMap,
+    );
+
+    expect(formattedValue).toEqual(expected);
+  });
 });
 
 // eslint-disable-next-line no-restricted-globals -- TODO: Migrate from describe blocks