You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ms...@apache.org on 2026/01/14 06:29:09 UTC

(superset) branch msyavuz/fix/categorical-initialization updated (fbe3f43190 -> 9c40ced3e3)

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

msyavuz pushed a change to branch msyavuz/fix/categorical-initialization
in repository https://gitbox.apache.org/repos/asf/superset.git


 discard fbe3f43190 fix(controls): Only initialize categorical value on numeric column
     new 9c40ced3e3 fix(controls): Only initialize categorical control on numeric x axis

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   (fbe3f43190)
            \
             N -- N -- N   refs/heads/msyavuz/fix/categorical-initialization (9c40ced3e3)

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:
 .../src/shared-controls/customControls.tsx                           | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)


(superset) 01/01: fix(controls): Only initialize categorical control on numeric x axis

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

msyavuz pushed a commit to branch msyavuz/fix/categorical-initialization
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 9c40ced3e3844625fdc43c7b3b95427d7df55823
Author: Mehmet Salih Yavuz <sa...@proton.me>
AuthorDate: Wed Jan 14 09:28:40 2026 +0300

    fix(controls): Only initialize categorical control on numeric x axis
---
 .../src/shared-controls/customControls.tsx                  | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/customControls.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/customControls.tsx
index fc8f16ee88..f59a7e9898 100644
--- a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/customControls.tsx
+++ b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/customControls.tsx
@@ -218,8 +218,17 @@ export const xAxisForceCategoricalControl = {
     label: () => t('Force categorical'),
     default: false,
     description: t('Treat values as categorical.'),
-    initialValue: (control: ControlState, state: ControlPanelState | null) =>
-      state?.form_data?.x_axis_sort !== undefined || control.value,
+    initialValue: (control: ControlState, state: ControlPanelState | null) => {
+      const isNumericXAxis = checkColumnType(
+        getColumnLabel(state?.controls?.x_axis?.value as QueryFormColumn),
+        state?.controls?.datasource?.datasource,
+        [GenericDataType.Numeric],
+      );
+      if (!isNumericXAxis) {
+        return control.value;
+      }
+      return state?.form_data?.x_axis_sort !== undefined || control.value;
+    },
     renderTrigger: true,
     visibility: ({ controls }: { controls: ControlStateMapping }) =>
       checkColumnType(