You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "EnxDev (via GitHub)" <gi...@apache.org> on 2026/03/23 18:47:20 UTC

[PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

EnxDev opened a new pull request, #38809:
URL: https://github.com/apache/superset/pull/38809

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   Superset's timeseries charts (Bar, Line, SmoothLine, Area, Step) only offered a Time Format control for the X-axis, which works well for temporal columns but breaks when users select a numeric column like year. Since year is stored as an integer (e.g. 2024), the default `SMART_NUMBER` formatter applies SI prefixes and renders it as 2.02k. 
   Changing the Time Format to %Y has no effect because the column isn't a timestamp  it's just a plain number.
   
   This PR brings the fix originally introduced for Scatter charts in #35915 to all remaining timeseries chart types. It adds an X Axis Number Format control that conditionally appears when the selected X-axis column is numeric, while hiding the Time Format control since time directives are meaningless for number values. The number format defaults to d (decimal integer), ensuring values like 2024 display as-is without SI suffixes.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   - Before
   
   https://github.com/user-attachments/assets/284c9748-1aa0-4457-96ec-8eb149126a07
   
   - After
   
   https://github.com/user-attachments/assets/4f71663c-e86c-44b9-b649-a8a52b497971
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   1. Create a Bar chart using a dataset with an integer column (e.g. year)
   2. Drag the integer column to X-AXIS
   3. Go to Customize tab → X Axis section
   4. Verify X Axis Number Format appears (not Time Format)
   5. Verify the X-axis labels show full values (e.g. 2024, not 2.02k)
   6. Repeat for Line, SmoothLine, Area, and Step chart types
   7. Verify that using a timestamp column on X-axis still shows the Time Format control
   
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #38809:
URL: https://github.com/apache/superset/pull/38809#discussion_r2991137330


##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/SmoothLine/controlPanel.test.ts:
##########
@@ -0,0 +1,125 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { ControlPanelsContainerProps } from '@superset-ui/chart-controls/types';
+import { GenericDataType } from '@apache-superset/core/common';
+import controlPanel from '../../../src/Timeseries/Regular/SmoothLine/controlPanel';
+
+const config = controlPanel;
+
+const getControl = (controlName: string) => {
+  for (const section of config.controlPanelSections) {
+    if (section && section.controlSetRows) {
+      for (const row of section.controlSetRows) {
+        for (const control of row) {
+          if (
+            typeof control === 'object' &&
+            control !== null &&
+            'name' in control &&
+            control.name === controlName
+          ) {
+            return control;
+          }
+        }
+      }
+    }
+  }
+
+  return null;
+};
+
+const mockControls = (
+  xAxisColumn: string | null,
+  typeGeneric: GenericDataType | null,
+): ControlPanelsContainerProps => {
+  const columns =
+    xAxisColumn && typeGeneric !== null
+      ? [{ column_name: xAxisColumn, type_generic: typeGeneric }]
+      : [];
+
+  return {
+    controls: {
+      // @ts-expect-error
+      x_axis: {
+        value: xAxisColumn,
+      },
+      // @ts-expect-error
+      datasource: {
+        datasource: { columns },
+      },
+    },
+  };
+};
+
+const timeFormatControl: any = getControl('x_axis_time_format');
+const numberFormatControl: any = getControl('x_axis_number_format');
+
+test('should include x_axis_time_format control', () => {
+  expect(timeFormatControl).toBeDefined();
+  expect(timeFormatControl.config.default).toBe('smart_date');
+});
+
+test('x_axis_time_format should be visible for temporal columns', () => {
+  const visibilityFn = timeFormatControl?.config?.visibility;
+  if (visibilityFn) {
+    expect(visibilityFn(mockControls('date', GenericDataType.Temporal))).toBe(
+      true,
+    );
+  } else {
+    // no visibility function means always visible
+    expect(true).toBe(true);
+  }
+});
+
+test('x_axis_time_format should be visible for numeric columns', () => {
+  const visibilityFn = timeFormatControl?.config?.visibility;
+  if (visibilityFn) {
+    expect(visibilityFn(mockControls('year', GenericDataType.Numeric))).toBe(
+      true,
+    );
+  } else {
+    // no visibility function means always visible
+    expect(true).toBe(true);
+  }

Review Comment:
   **Suggestion:** The numeric X-axis visibility expectation is inverted: this test currently asserts that the time format control should be visible for numeric columns, which contradicts the intended behavior and the other timeseries tests. Update it to assert hidden for numeric columns so regressions are caught correctly. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ SmoothLine Customize tab validates wrong numeric behavior.
   - ⚠️ CI passes despite incorrect X-axis visibility logic.
   ```
   </details>
   
   ```suggestion
   test('x_axis_time_format should be hidden for numeric columns', () => {
     const visibilityFn = timeFormatControl?.config?.visibility;
     expect(visibilityFn).toBeDefined();
     expect(visibilityFn(mockControls('year', GenericDataType.Numeric))).toBe(
       false,
     );
   ```
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Open SmoothLine control config at
   `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx:112-118`;
   `x_axis_time_format` has no `visibility` callback.
   
   2. Open control rendering path at
   `superset-frontend/src/explore/components/ControlPanelsContainer.tsx:23-25` (offset 490
   read); missing control visibility returns `undefined`, so control is not explicitly
   hidden.
   
   3. Compare sibling chart tests: Line/Area/Step/Bar assert numeric should hide time format
   (`test/Timeseries/Line/controlPanel.test.ts:20-25`, `Area:20-25`, `Step:20-25`,
   `Bar:20-25` in read snippets).
   
   4. Run SmoothLine test file; current test at `.../SmoothLine/controlPanel.test.ts:89-99`
   expects numeric visibility `true`, so it passes while validating opposite behavior.
   
   5. Result: regression is masked—test suite green despite SmoothLine not enforcing
   numeric-hide logic expected by other timeseries charts.
   ```
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/SmoothLine/controlPanel.test.ts
   **Line:** 89:98
   **Comment:**
   	*Logic Error: The numeric X-axis visibility expectation is inverted: this test currently asserts that the time format control should be visible for numeric columns, which contradicts the intended behavior and the other timeseries tests. Update it to assert hidden for numeric columns so regressions are caught correctly.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=6807105f955dacb924232eaa988954593bffb498bf011170f5e77f11e5bee094&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=6807105f955dacb924232eaa988954593bffb498bf011170f5e77f11e5bee094&reaction=dislike'>👎</a>



##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/SmoothLine/controlPanel.test.ts:
##########
@@ -0,0 +1,125 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { ControlPanelsContainerProps } from '@superset-ui/chart-controls/types';
+import { GenericDataType } from '@apache-superset/core/common';
+import controlPanel from '../../../src/Timeseries/Regular/SmoothLine/controlPanel';
+
+const config = controlPanel;
+
+const getControl = (controlName: string) => {
+  for (const section of config.controlPanelSections) {
+    if (section && section.controlSetRows) {
+      for (const row of section.controlSetRows) {
+        for (const control of row) {
+          if (
+            typeof control === 'object' &&
+            control !== null &&
+            'name' in control &&
+            control.name === controlName
+          ) {
+            return control;
+          }
+        }
+      }
+    }
+  }
+
+  return null;
+};
+
+const mockControls = (
+  xAxisColumn: string | null,
+  typeGeneric: GenericDataType | null,
+): ControlPanelsContainerProps => {
+  const columns =
+    xAxisColumn && typeGeneric !== null
+      ? [{ column_name: xAxisColumn, type_generic: typeGeneric }]
+      : [];
+
+  return {
+    controls: {
+      // @ts-expect-error
+      x_axis: {
+        value: xAxisColumn,
+      },
+      // @ts-expect-error
+      datasource: {
+        datasource: { columns },
+      },
+    },
+  };
+};
+
+const timeFormatControl: any = getControl('x_axis_time_format');
+const numberFormatControl: any = getControl('x_axis_number_format');
+
+test('should include x_axis_time_format control', () => {
+  expect(timeFormatControl).toBeDefined();
+  expect(timeFormatControl.config.default).toBe('smart_date');
+});
+
+test('x_axis_time_format should be visible for temporal columns', () => {
+  const visibilityFn = timeFormatControl?.config?.visibility;
+  if (visibilityFn) {
+    expect(visibilityFn(mockControls('date', GenericDataType.Temporal))).toBe(
+      true,
+    );
+  } else {
+    // no visibility function means always visible
+    expect(true).toBe(true);
+  }

Review Comment:
   **Suggestion:** This test has a vacuous fallback (`expect(true).toBe(true)`) that always passes when the visibility function is missing, so it will not fail if the control loses its visibility logic. Assert that the visibility callback exists and evaluate it directly. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Temporal visibility test becomes non-validating tautology.
   - ⚠️ Missing callback regressions escape SmoothLine CI coverage.
   ```
   </details>
   
   ```suggestion
     expect(visibilityFn).toBeDefined();
     expect(visibilityFn(mockControls('date', GenericDataType.Temporal))).toBe(
       true,
     );
   ```
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Inspect
   `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx:112-118`;
   `x_axis_time_format` currently lacks a `visibility` function.
   
   2. In test `.../SmoothLine/controlPanel.test.ts:77-87`, the `else` branch uses
   `expect(true).toBe(true)`, which always passes when visibility is absent.
   
   3. Execute this test: because `visibilityFn` is `undefined`, branch at lines `83-86` is
   taken and test succeeds without asserting real logic.
   
   4. Contrast with other chart tests (`Line/Area/Step` snippets) that directly call
   `visibilityFn(...)`, meaning missing callback would fail and reveal regression.
   
   5. Therefore, SmoothLine temporal test is vacuous under current code and cannot detect
   loss/misconfiguration of visibility logic.
   ```
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/SmoothLine/controlPanel.test.ts
   **Line:** 79:86
   **Comment:**
   	*Logic Error: This test has a vacuous fallback (`expect(true).toBe(true)`) that always passes when the visibility function is missing, so it will not fail if the control loses its visibility logic. Assert that the visibility callback exists and evaluate it directly.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=35911538b0f47dbc259cd388f547fd352a285f3c3cf158661c666608e1289eeb&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=35911538b0f47dbc259cd388f547fd352a285f3c3cf158661c666608e1289eeb&reaction=dislike'>👎</a>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "EnxDev (via GitHub)" <gi...@apache.org>.
EnxDev commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4143250040

   > wich approach do you suggest to test it? 
   
   wich approach do you suggest to test it? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4143325602

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4156559119

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz commented on code in PR #38809:
URL: https://github.com/apache/superset/pull/38809#discussion_r3010567233


##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx:
##########
@@ -114,6 +117,22 @@ const config: ControlPanelConfig = {
             },

Review Comment:
   This is also relevant



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "EnxDev (via GitHub)" <gi...@apache.org>.
EnxDev closed pull request #38809: fix(charts): add X Axis Number Format control for numeric X-axis columns
URL: https://github.com/apache/superset/pull/38809


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4155216556

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) deployed environment on [GHA](https://github.com/apache/superset/actions/runs/23746942780) for [f6de13c](https://github.com/apache/superset/commit/f6de13c)
   
   • **Environment:** http://35.86.103.173:8080 (admin/admin)
   • **Lifetime:** 48h auto-cleanup
   • **Updates:** New commits create fresh environments automatically


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4145487497

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4112934704

   ## **Sequence Diagram**
   
   This PR updates timeseries chart control panels to choose the X axis format control based on the selected column type. Numeric X axis columns now use a number format control, while time columns continue using time format, preventing incorrect compact number display for values like years.
   
   ```mermaid
   sequenceDiagram
       participant User
       participant ControlPanel
       participant TypeCheck
       participant Chart
   
       User->>ControlPanel: Select X axis column
       ControlPanel->>TypeCheck: Evaluate selected column type
       TypeCheck-->>ControlPanel: Return numeric or time or other
   
       alt Numeric column
           ControlPanel-->>User: Show X axis number format and hide time format
           User->>ControlPanel: Choose number format
           ControlPanel->>Chart: Apply numeric X axis label formatting
       else Time or non numeric column
           ControlPanel-->>User: Show time format and hide number format
       end
   ```
   
   ---
   *Generated by [CodeAnt AI](https://codeant.ai)*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #38809:
URL: https://github.com/apache/superset/pull/38809#discussion_r3008570562


##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/SmoothLine/controlPanel.test.ts:
##########
@@ -0,0 +1,117 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { ControlPanelsContainerProps } from '@superset-ui/chart-controls/types';
+import { GenericDataType } from '@apache-superset/core/common';
+import controlPanel from '../../../src/Timeseries/Regular/SmoothLine/controlPanel';
+
+const config = controlPanel;
+
+const getControl = (controlName: string) => {
+  for (const section of config.controlPanelSections) {
+    if (section && section.controlSetRows) {
+      for (const row of section.controlSetRows) {
+        for (const control of row) {
+          if (
+            typeof control === 'object' &&
+            control !== null &&
+            'name' in control &&
+            control.name === controlName
+          ) {
+            return control;
+          }
+        }
+      }
+    }
+  }
+
+  return null;
+};
+
+const mockControls = (
+  xAxisColumn: string | null,
+  typeGeneric: GenericDataType | null,
+): ControlPanelsContainerProps => {
+  const columns =
+    xAxisColumn && typeGeneric !== null
+      ? [{ column_name: xAxisColumn, type_generic: typeGeneric }]
+      : [];
+
+  return {
+    controls: {
+      // @ts-expect-error
+      x_axis: {
+        value: xAxisColumn,
+      },
+      // @ts-expect-error
+      datasource: {
+        datasource: { columns },
+      },
+    },
+  };
+};
+
+const timeFormatControl: any = getControl('x_axis_time_format');
+const numberFormatControl: any = getControl('x_axis_number_format');
+
+test('should include x_axis_time_format control', () => {
+  expect(timeFormatControl).toBeDefined();
+  expect(timeFormatControl.config.default).toBe('smart_date');
+});
+
+test('x_axis_time_format should be visible for temporal columns', () => {
+  const visibilityFn = timeFormatControl?.config?.visibility;
+  expect(visibilityFn).toBeDefined();
+  expect(visibilityFn(mockControls('date', GenericDataType.Temporal))).toBe(
+    true,
+  );
+});
+
+test('x_axis_time_format should be hidden for numeric columns', () => {

Review Comment:
   <!-- Bito Reply -->
   This question isn’t related to the pull request. I can only help with questions about the PR’s code or comments.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4126656122

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz commented on code in PR #38809:
URL: https://github.com/apache/superset/pull/38809#discussion_r2987777645


##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx:
##########
@@ -181,6 +184,32 @@ const config: ControlPanelConfig = {
               ...sharedControls.x_axis_time_format,
               default: 'smart_date',
               description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
+              visibility: ({ controls }: ControlPanelsContainerProps) =>
+                !checkColumnType(
+                  getColumnLabel(
+                    controls?.x_axis?.value as QueryFormColumn,
+                  ),
+                  controls?.datasource?.datasource,
+                  [GenericDataType.Numeric],

Review Comment:
   Should this be `GenericDataType.Temporal` instead without `!`?



##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx:
##########
@@ -163,7 +177,23 @@ function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
           default: 'smart_date',
           description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
           visibility: ({ controls }: ControlPanelsContainerProps) =>
-            isXAxis ? isVertical(controls) : isHorizontal(controls),
+            (isXAxis ? isVertical(controls) : isHorizontal(controls)) &&
+            !isNumericXAxis(controls),

Review Comment:
   This might be better served as if/else blocks, it's a bit hard to read now. Personal preference though



##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx:
##########
@@ -111,6 +114,28 @@ const config: ControlPanelConfig = {
               ...sharedControls.x_axis_time_format,
               default: 'smart_date',
               description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
+              visibility: ({ controls }: ControlPanelsContainerProps) =>
+                !checkColumnType(
+                  getColumnLabel(controls?.x_axis?.value as QueryFormColumn),
+                  controls?.datasource?.datasource,
+                  [GenericDataType.Numeric],
+                ),

Review Comment:
   And here. Am i missing a piece where this is necessary?



##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx:
##########
@@ -146,6 +149,28 @@ const config: ControlPanelConfig = {
               ...sharedControls.x_axis_time_format,
               default: 'smart_date',
               description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
+              visibility: ({ controls }: ControlPanelsContainerProps) =>
+                !checkColumnType(
+                  getColumnLabel(controls?.x_axis?.value as QueryFormColumn),
+                  controls?.datasource?.datasource,
+                  [GenericDataType.Numeric],
+                ),

Review Comment:
   Same thing with `GenericDataType.Temporal` here



##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Bar/controlPanel.test.ts:
##########


Review Comment:
   Do we need tests for other chart types as well?



##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx:
##########
@@ -112,53 +115,30 @@ const config: ControlPanelConfig = {
               ...sharedControls.x_axis_time_format,
               default: 'smart_date',
               description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
-              visibility: ({ controls }: ControlPanelsContainerProps) => {
-                // check if x axis is a time column
-                const xAxisColumn = controls?.x_axis?.value;
-                const xAxisOptions = controls?.x_axis?.options;
-
-                if (!xAxisColumn || !Array.isArray(xAxisOptions)) {
-                  return false;
-                }
-
-                const xAxisType = xAxisOptions.find(
-                  option => option.column_name === xAxisColumn,
-                )?.type;
-
-                return (
-                  typeof xAxisType === 'string' &&
-                  xAxisType.toUpperCase().includes('TIME')
-                );
-              },
+              visibility: ({ controls }: ControlPanelsContainerProps) =>
+                !checkColumnType(
+                  getColumnLabel(
+                    controls?.x_axis?.value as QueryFormColumn,
+                  ),
+                  controls?.datasource?.datasource,
+                  [GenericDataType.Numeric],
+                ),

Review Comment:
   here as well



##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx:
##########
@@ -163,6 +166,28 @@ const config: ControlPanelConfig = {
               ...sharedControls.x_axis_time_format,
               default: 'smart_date',
               description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
+              visibility: ({ controls }: ControlPanelsContainerProps) =>
+                !checkColumnType(
+                  getColumnLabel(controls?.x_axis?.value as QueryFormColumn),
+                  controls?.datasource?.datasource,
+                  [GenericDataType.Numeric],
+                ),

Review Comment:
   and here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4144398286

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz merged PR #38809:
URL: https://github.com/apache/superset/pull/38809


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "EnxDev (via GitHub)" <gi...@apache.org>.
EnxDev commented on code in PR #38809:
URL: https://github.com/apache/superset/pull/38809#discussion_r3009764180


##########
superset-frontend/src/core/sqlLab/sqlLab.test.ts:
##########


Review Comment:
   yes is the formatter, as you can see the code is the same



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #38809:
URL: https://github.com/apache/superset/pull/38809#discussion_r2976952466


##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx:
##########
@@ -154,6 +154,37 @@ function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
     Boolean(controls?.orientation.value === OrientationType.Vertical);
   const isHorizontal = (controls: ControlStateMapping) =>
     Boolean(controls?.orientation.value === OrientationType.Horizontal);
+  const isNumericColumn = (controls: ControlStateMapping) => {
+    const xAxisColumn = controls?.x_axis?.value;
+    const xAxisOptions = controls?.x_axis?.options;
+    if (!xAxisColumn || !Array.isArray(xAxisOptions)) {
+      return false;
+    }
+    const xAxisType = xAxisOptions.find(
+      (option: { column_name: string; type?: string }) =>
+        option.column_name === xAxisColumn,
+    )?.type;
+    if (typeof xAxisType !== 'string') {
+      return false;
+    }
+    const typeUpper = xAxisType.toUpperCase();
+    if (typeUpper.includes('TIME')) {
+      return false;
+    }
+    return [
+      'INT',
+      'INTEGER',
+      'BIGINT',
+      'SMALLINT',
+      'TINYINT',
+      'FLOAT',
+      'DOUBLE',
+      'REAL',
+      'NUMERIC',
+      'DECIMAL',

Review Comment:
   **Suggestion:** Numeric type detection omits the common SQL type `NUMBER`, so those columns are treated as non-numeric and the wrong formatter control is shown. Include `NUMBER` in the allowed numeric type list to avoid misclassification. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ NUMBER-typed X columns show wrong formatter control.
   - ⚠️ Users must manually workaround numeric label formatting.
   ```
   </details>
   
   ```suggestion
             'NUMBER',
   ```
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Use Bar chart Explore path (registered via `.../Timeseries/Regular/Bar/index.ts:55`)
   and pick an X-axis column whose datasource `type` is `NUMBER`.
   
   2. Backend engines can expose `NUMBER` as numeric (e.g. OceanBase maps `^number.*` to
   numeric at `superset/db_engine_specs/oceanbase.py:156-157`), so this type string is
   realistic in metadata.
   
   3. In `isNumericColumn()` (`.../Bar/controlPanel.tsx:157-186`), `typeUpper` is checked
   against a hardcoded list that omits `NUMBER`.
   
   4. Function returns false, making `x_axis_number_format` hidden and `x_axis_time_format`
   visible (`.../Bar/controlPanel.tsx:196-213`), so numeric columns are misclassified in
   Customize UI.
   ```
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx
   **Line:** 184:184
   **Comment:**
   	*Logic Error: Numeric type detection omits the common SQL type `NUMBER`, so those columns are treated as non-numeric and the wrong formatter control is shown. Include `NUMBER` in the allowed numeric type list to avoid misclassification.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=538513e52ae196d83b2cc20cc949feecf22c63dbd825b5ceacef181ddfa13c36&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=538513e52ae196d83b2cc20cc949feecf22c63dbd825b5ceacef181ddfa13c36&reaction=dislike'>👎</a>



##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx:
##########
@@ -146,6 +146,73 @@ const config: ControlPanelConfig = {
               ...sharedControls.x_axis_time_format,
               default: 'smart_date',
               description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
+              visibility: ({ controls }: ControlPanelsContainerProps) => {
+                const xAxisColumn = controls?.x_axis?.value;
+                const xAxisOptions = controls?.x_axis?.options;
+                if (!xAxisColumn || !Array.isArray(xAxisOptions)) {
+                  return true;
+                }
+                const xAxisType = (
+                  xAxisOptions as { column_name: string; type?: string }[]
+                ).find(option => option.column_name === xAxisColumn)?.type;
+                if (typeof xAxisType !== 'string') {
+                  return true;
+                }
+                const typeUpper = xAxisType.toUpperCase();
+                if (typeUpper.includes('TIME')) {
+                  return true;
+                }
+                return ![
+                  'INT',
+                  'INTEGER',
+                  'BIGINT',
+                  'SMALLINT',
+                  'TINYINT',
+                  'FLOAT',
+                  'DOUBLE',
+                  'REAL',
+                  'NUMERIC',
+                  'DECIMAL',
+                ].some(t => typeUpper.includes(t));
+              },
+            },
+          },
+        ],
+        [
+          {
+            name: 'x_axis_number_format',
+            config: {
+              ...sharedControls.x_axis_number_format,
+              mapStateToProps: undefined,

Review Comment:
   **Suggestion:** The new numeric X-axis control still inherits `SMART_NUMBER` as its default from shared controls, so numeric years (for example `2024`) will continue to render with SI abbreviations (like `2.02k`) unless users manually change the format. Set an explicit integer default for this control to make the fix work out of the box. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Critical 🚨</summary>
   
   ```mdx
   - ⚠️ Numeric X-axis labels abbreviate years by default.
   - ❌ PR's intended out-of-box fix remains incomplete.
   ```
   </details>
   
   ```suggestion
                 default: 'd',
   ```
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Open Explore with the Line chart plugin; `EchartsTimeseriesLineChartPlugin` wires this
   control panel via `controlPanel` in
   `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/index.ts:53`.
   
   2. In Customize → X Axis, select a numeric X-axis column (for example integer year);
   `x_axis_number_format` is shown by numeric-type visibility logic at
   `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx:183-215`.
   
   3. Leave X Axis Number Format unchanged; this control inherits `default:
   DEFAULT_NUMBER_FORMAT` from shared control config
   (`superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx:356`),
   where `DEFAULT_NUMBER_FORMAT` resolves to the first D3 option (`D3_FORMAT_OPTIONS[0][0]`)
   and that option is `NumberFormats.SMART_NUMBER` (`.../utils/D3Formatting.ts:55,88`).
   
   4. Run/render chart; timeseries rendering uses `getNumberFormatter(xAxisNumberFormat)` for
   numeric X axes at
   `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:639`, and
   default form data also sets `xAxisNumberFormat: 'SMART_NUMBER'` at
   `.../Timeseries/constants.ts:75`, so values like `2024` are abbreviated (e.g., `2.02k`)
   unless manually overridden.
   ```
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx
   **Line:** 186:186
   **Comment:**
   	*Logic Error: The new numeric X-axis control still inherits `SMART_NUMBER` as its default from shared controls, so numeric years (for example `2024`) will continue to render with SI abbreviations (like `2.02k`) unless users manually change the format. Set an explicit integer default for this control to make the fix work out of the box.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=fbfb91a23718ddea80a4b5021fb7647bfdf5f3c0e6d27fea78b6c6f32319e6c4&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=fbfb91a23718ddea80a4b5021fb7647bfdf5f3c0e6d27fea78b6c6f32319e6c4&reaction=dislike'>👎</a>



##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx:
##########
@@ -155,9 +156,22 @@ const config: ControlPanelConfig = {
 
                 const typeUpper = xAxisType.toUpperCase();
 
-                return ['FLOAT', 'DOUBLE', 'REAL', 'NUMERIC', 'DECIMAL'].some(
-                  t => typeUpper.includes(t),
-                );
+                if (typeUpper.includes('TIME')) {
+                  return false;
+                }
+
+                return [
+                  'INT',
+                  'INTEGER',
+                  'BIGINT',
+                  'SMALLINT',
+                  'TINYINT',
+                  'FLOAT',
+                  'DOUBLE',
+                  'REAL',
+                  'NUMERIC',
+                  'DECIMAL',
+                ].some(t => typeUpper.includes(t));

Review Comment:
   **Suggestion:** Numeric detection omits the `NUMBER` SQL type, so valid numeric X-axis columns from connectors that report `NUMBER` will hide both number and time format controls. Include `NUMBER` in the allowed numeric type list. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ NUMBER columns lose both X-axis formatting controls.
   - ⚠️ Connector-specific numeric columns get poor UX.
   - ❌ Users cannot correct numeric label display.
   ```
   </details>
   
   ```suggestion
                     'NUMBER',
   ```
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Use a datasource whose physical type is `NUMBER` (supported in backend: `NUMBER` type
   class in `superset/db_engine_specs/oceanbase.py:50-51`, mapped as numeric in
   `oceanbase.py:156-158`).
   
   2. In Explore Scatter (plugin path in `MainPreset.ts:163-165` and `Scatter/index.ts:51`),
   select that `NUMBER` column as `x_axis`; control options include raw `type` used by
   visibility logic (`Scatter/controlPanel.tsx:149-151`).
   
   3. `x_axis_number_format` visibility check at `Scatter/controlPanel.tsx:163-174` returns
   false because `NUMBER` is absent from the allowlist.
   
   4. `x_axis_time_format` is also hidden for non-time types
   (`Scatter/controlPanel.tsx:128-131`), leaving no X-axis format control available.
   ```
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx
   **Line:** 174:174
   **Comment:**
   	*Logic Error: Numeric detection omits the `NUMBER` SQL type, so valid numeric X-axis columns from connectors that report `NUMBER` will hide both number and time format controls. Include `NUMBER` in the allowed numeric type list.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=8ccaaa2c5a1e11348895468daaea843ab2fb61558b033010a3a46312b0c94bb5&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=8ccaaa2c5a1e11348895468daaea843ab2fb61558b033010a3a46312b0c94bb5&reaction=dislike'>👎</a>



##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx:
##########
@@ -111,6 +111,73 @@ const config: ControlPanelConfig = {
               ...sharedControls.x_axis_time_format,
               default: 'smart_date',
               description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
+              visibility: ({ controls }: ControlPanelsContainerProps) => {
+                const xAxisColumn = controls?.x_axis?.value;
+                const xAxisOptions = controls?.x_axis?.options;
+                if (!xAxisColumn || !Array.isArray(xAxisOptions)) {
+                  return true;
+                }
+                const xAxisType = (
+                  xAxisOptions as { column_name: string; type?: string }[]
+                ).find(option => option.column_name === xAxisColumn)?.type;
+                if (typeof xAxisType !== 'string') {
+                  return true;
+                }
+                const typeUpper = xAxisType.toUpperCase();
+                if (typeUpper.includes('TIME')) {
+                  return true;
+                }
+                return ![
+                  'INT',
+                  'INTEGER',
+                  'BIGINT',
+                  'SMALLINT',
+                  'TINYINT',
+                  'FLOAT',
+                  'DOUBLE',
+                  'REAL',
+                  'NUMERIC',
+                  'DECIMAL',
+                ].some(t => typeUpper.includes(t));

Review Comment:
   **Suggestion:** The numeric-type detection uses substring matching, which incorrectly classifies non-numeric types containing `INT` (for example `POINT` or `INTERVAL`) as numeric. This will hide the time format for non-numeric columns. Use whole-token matching instead of `includes`. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Wrong control visibility for `INTERVAL`-like column types.
   - ⚠️ Users see numeric formatting for non-numeric axes.
   - ❌ Time-format control hidden by misclassification.
   ```
   </details>
   
   ```suggestion
                   ].some(t => new RegExp(`\\b${t}\\b`).test(typeUpper));
   ```
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. In Explore, X-axis options come from datasource column metadata
   (`superset-frontend/src/explore/controls.tsx:18-21`) and include raw SQL type strings.
   
   2. Use a dataset containing a non-numeric type whose name contains `INT` (for example
   `INTERVAL`; backend type exists at `superset/models/sql_types/presto_sql_types.py:55`).
   
   3. Select that column as `x_axis`; time-format visibility runs in
   `.../SmoothLine/controlPanel.tsx:114-142`.
   
   4. Because it checks `typeUpper.includes('INT')`, the column is treated as numeric and
   `x_axis_time_format` is hidden even though type is non-numeric.
   ```
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx
   **Line:** 141:141
   **Comment:**
   	*Logic Error: The numeric-type detection uses substring matching, which incorrectly classifies non-numeric types containing `INT` (for example `POINT` or `INTERVAL`) as numeric. This will hide the time format for non-numeric columns. Use whole-token matching instead of `includes`.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=61aeb4de821515a6a78f232ab4e51f295f68b1f1322befeb390765df54588202&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=61aeb4de821515a6a78f232ab4e51f295f68b1f1322befeb390765df54588202&reaction=dislike'>👎</a>



##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx:
##########
@@ -111,6 +111,73 @@ const config: ControlPanelConfig = {
               ...sharedControls.x_axis_time_format,
               default: 'smart_date',
               description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
+              visibility: ({ controls }: ControlPanelsContainerProps) => {
+                const xAxisColumn = controls?.x_axis?.value;
+                const xAxisOptions = controls?.x_axis?.options;
+                if (!xAxisColumn || !Array.isArray(xAxisOptions)) {
+                  return true;
+                }
+                const xAxisType = (
+                  xAxisOptions as { column_name: string; type?: string }[]
+                ).find(option => option.column_name === xAxisColumn)?.type;
+                if (typeof xAxisType !== 'string') {
+                  return true;
+                }
+                const typeUpper = xAxisType.toUpperCase();
+                if (typeUpper.includes('TIME')) {
+                  return true;
+                }
+                return ![
+                  'INT',
+                  'INTEGER',
+                  'BIGINT',
+                  'SMALLINT',
+                  'TINYINT',
+                  'FLOAT',
+                  'DOUBLE',
+                  'REAL',
+                  'NUMERIC',
+                  'DECIMAL',
+                ].some(t => typeUpper.includes(t));
+              },
+            },
+          },
+        ],
+        [
+          {
+            name: 'x_axis_number_format',
+            config: {
+              ...sharedControls.x_axis_number_format,
+              mapStateToProps: undefined,

Review Comment:
   **Suggestion:** The new number-format control still inherits `SMART_NUMBER` as its default, so numeric X-axis values (like years) will continue rendering with SI suffixes until users manually change the format. Set the control default to an integer-friendly format to make the fix effective by default. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Critical 🚨</summary>
   
   ```mdx
   - ❌ Numeric X-axis labels abbreviate years by default.
   - ⚠️ Users must manually change formatter every chart.
   - ❌ PR's main UX fix is partially negated.
   ```
   </details>
   
   ```suggestion
                 default: ',d',
   ```
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Open Explore with Smooth Line chart plugin
   (`superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/index.ts:51`)
   which uses this control panel.
   
   2. Select an integer X-axis column (for example `year`) so `x_axis_number_format` becomes
   visible via the numeric visibility branch in `.../SmoothLine/controlPanel.tsx:152-180`.
   
   3. Leave X Axis Number Format unchanged; control inherits shared default
   (`superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx:27`)
   and timeseries fallback default is also `SMART_NUMBER` (`.../Timeseries/constants.ts:75`).
   
   4. Render chart; `transformProps` applies `getNumberFormatter(xAxisNumberFormat)` for
   numeric X-axis (`.../Timeseries/transformProps.ts:638-640`), so years are abbreviated
   (e.g. 2024 -> 2.02k).
   ```
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx
   **Line:** 151:151
   **Comment:**
   	*Logic Error: The new number-format control still inherits `SMART_NUMBER` as its default, so numeric X-axis values (like years) will continue rendering with SI suffixes until users manually change the format. Set the control default to an integer-friendly format to make the fix effective by default.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=807b6a26e3a8f26caf46f1a6c690ba0dfaa0907dc6d64356e2f4124e2efb3b15&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=807b6a26e3a8f26caf46f1a6c690ba0dfaa0907dc6d64356e2f4124e2efb3b15&reaction=dislike'>👎</a>



##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx:
##########
@@ -136,8 +136,9 @@ const config: ControlPanelConfig = {
             name: 'x_axis_number_format',
             config: {
               ...sharedControls.x_axis_number_format,
+              mapStateToProps: undefined,
               visibility: ({ controls }: ControlPanelsContainerProps) => {

Review Comment:
   **Suggestion:** The numeric X-axis formatter still inherits the shared default (`SMART_NUMBER`), so integer-like axis values will continue to abbreviate (for example, 2024 -> 2.02k) unless users manually change it. Set the control default to a plain integer format to make numeric X-axis labels readable out of the box. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Critical 🚨</summary>
   
   ```mdx
   - ❌ Numeric X-axis labels abbreviate unexpectedly by default.
   - ⚠️ Users must manually fix formatting each chart.
   - ❌ Year-like values render unreadably in Scatter axis.
   ```
   </details>
   
   ```suggestion
                 default: 'd',
   ```
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Open Explore with Scatter chart (`VizType.Scatter` registered in
   `superset-frontend/src/visualizations/presets/MainPreset.ts:163-165`), which loads this
   control panel via
   `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/index.ts:51`.
   
   2. In Customize → X Axis, pick an integer X-axis column; `x_axis_number_format` becomes
   visible from
   `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx:136-175`.
   
   3. Do not change the number format control. It inherits shared default from
   `sharedControls.x_axis_number_format`
   (`superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx:27`),
   which is `DEFAULT_NUMBER_FORMAT` (`SMART_NUMBER`).
   
   4. Run the chart; formatter is applied through `getNumberFormatter(xAxisNumberFormat)` in
   `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:636-640`,
   so year-like values (e.g., 2024) abbreviate (e.g., 2.02k).
   ```
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx
   **Line:** 140:140
   **Comment:**
   	*Logic Error: The numeric X-axis formatter still inherits the shared default (`SMART_NUMBER`), so integer-like axis values will continue to abbreviate (for example, 2024 -> 2.02k) unless users manually change it. Set the control default to a plain integer format to make numeric X-axis labels readable out of the box.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=a6a4ecaed9b975998177d3501d7ec272dd6ff4bff1d50445610c33c14fec91ac&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=a6a4ecaed9b975998177d3501d7ec272dd6ff4bff1d50445610c33c14fec91ac&reaction=dislike'>👎</a>



##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx:
##########
@@ -163,7 +194,22 @@ function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
           default: 'smart_date',
           description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
           visibility: ({ controls }: ControlPanelsContainerProps) =>
-            isXAxis ? isVertical(controls) : isHorizontal(controls),
+            (isXAxis ? isVertical(controls) : isHorizontal(controls)) &&
+            !isNumericColumn(controls),
+          disableStash: true,
+          resetOnHide: false,
+        },
+      },
+    ],
+    [
+      {
+        name: 'x_axis_number_format',
+        config: {
+          ...sharedControls.x_axis_number_format,
+          mapStateToProps: undefined,

Review Comment:
   **Suggestion:** The new numeric X-axis formatter control does not override the shared default format, so it still defaults to adaptive formatting (`SMART_NUMBER`) and will abbreviate values like `2024` as `2.02k`. Set the control default to an integer format to make the fix actually apply without manual user input. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Critical 🚨</summary>
   
   ```mdx
   - ⚠️ Bar chart numeric X labels abbreviate unexpectedly.
   - ⚠️ PR's stated default integer-display behavior not met.
   ```
   </details>
   
   ```suggestion
                       default: 'd',
   ```
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Open Bar chart Explore flow; plugin wires this control panel via
   `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/index.ts:28,55`
   (`controlPanel` is used at runtime).
   
   2. In `createAxisControl()` at `.../Bar/controlPanel.tsx:206-213`, `x_axis_number_format`
   spreads `sharedControls.x_axis_number_format` but does not override `default`.
   
   3. `sharedControls.x_axis_number_format` default is `DEFAULT_NUMBER_FORMAT`
   (`superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx:348-357`),
   and `DEFAULT_NUMBER_FORMAT` resolves to first D3 format option (`.../D3Formatting.ts:88`),
   which is `SMART_NUMBER` (`superset-frontend/src/explore/controls.tsx:96`).
   
   4. For numeric X-axis, chart rendering uses `getNumberFormatter(xAxisNumberFormat)`
   (`superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:638-639`),
   so values like `2024` are abbreviated unless user manually changes the control.
   ```
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx
   **Line:** 209:209
   **Comment:**
   	*Logic Error: The new numeric X-axis formatter control does not override the shared default format, so it still defaults to adaptive formatting (`SMART_NUMBER`) and will abbreviate values like `2024` as `2.02k`. Set the control default to an integer format to make the fix actually apply without manual user input.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=4d3fe69e0895702d56ee6ec63c8fee811401941502b96160ee9fd72bdb5de380&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=4d3fe69e0895702d56ee6ec63c8fee811401941502b96160ee9fd72bdb5de380&reaction=dislike'>👎</a>



##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx:
##########
@@ -111,6 +111,73 @@ const config: ControlPanelConfig = {
               ...sharedControls.x_axis_time_format,
               default: 'smart_date',
               description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
+              visibility: ({ controls }: ControlPanelsContainerProps) => {
+                const xAxisColumn = controls?.x_axis?.value;
+                const xAxisOptions = controls?.x_axis?.options;
+                if (!xAxisColumn || !Array.isArray(xAxisOptions)) {
+                  return true;
+                }
+                const xAxisType = (
+                  xAxisOptions as { column_name: string; type?: string }[]
+                ).find(option => option.column_name === xAxisColumn)?.type;
+                if (typeof xAxisType !== 'string') {
+                  return true;
+                }
+                const typeUpper = xAxisType.toUpperCase();
+                if (typeUpper.includes('TIME')) {
+                  return true;
+                }
+                return ![
+                  'INT',
+                  'INTEGER',
+                  'BIGINT',
+                  'SMALLINT',
+                  'TINYINT',
+                  'FLOAT',
+                  'DOUBLE',
+                  'REAL',
+                  'NUMERIC',
+                  'DECIMAL',
+                ].some(t => typeUpper.includes(t));
+              },
+            },
+          },
+        ],
+        [
+          {
+            name: 'x_axis_number_format',
+            config: {
+              ...sharedControls.x_axis_number_format,
+              mapStateToProps: undefined,
+              visibility: ({ controls }: ControlPanelsContainerProps) => {
+                const xAxisColumn = controls?.x_axis?.value;
+                const xAxisOptions = controls?.x_axis?.options;
+                if (!xAxisColumn || !Array.isArray(xAxisOptions)) {
+                  return false;
+                }
+                const xAxisType = (
+                  xAxisOptions as { column_name: string; type?: string }[]
+                ).find(option => option.column_name === xAxisColumn)?.type;
+                if (typeof xAxisType !== 'string') {
+                  return false;
+                }
+                const typeUpper = xAxisType.toUpperCase();
+                if (typeUpper.includes('TIME')) {
+                  return false;
+                }
+                return [
+                  'INT',
+                  'INTEGER',
+                  'BIGINT',
+                  'SMALLINT',
+                  'TINYINT',
+                  'FLOAT',
+                  'DOUBLE',
+                  'REAL',
+                  'NUMERIC',
+                  'DECIMAL',
+                ].some(t => typeUpper.includes(t));

Review Comment:
   **Suggestion:** The numeric visibility check has the same substring-matching issue and can show the number format for non-numeric types containing `INT` as part of another word. Switch to whole-token matching so only true numeric data types enable this control. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Number-format control appears for non-numeric axis types.
   - ⚠️ Misleading Customize panel behavior in Explore.
   - ⚠️ Inconsistent with actual `GenericDataType` formatter path.
   ```
   </details>
   
   ```suggestion
                   ].some(t => new RegExp(`\\b${t}\\b`).test(typeUpper));
   ```
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Open Smooth Line Explore controls; plugin wires this panel in
   `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/index.ts:51`.
   
   2. Pick an X-axis column whose type string contains `INT` but is not numeric (same
   metadata source: `superset-frontend/src/explore/controls.tsx:18-21`; example type
   `INTERVAL` exists in backend type system at
   `superset/models/sql_types/presto_sql_types.py:55`).
   
   3. `x_axis_number_format` visibility executes `.../SmoothLine/controlPanel.tsx:152-180`.
   
   4. `typeUpper.includes('INT')` returns true, so number-format control is shown for a
   non-numeric type.
   ```
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx
   **Line:** 179:179
   **Comment:**
   	*Logic Error: The numeric visibility check has the same substring-matching issue and can show the number format for non-numeric types containing `INT` as part of another word. Switch to whole-token matching so only true numeric data types enable this control.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=834bcc4de62ed88ee9cc127ef8fbf10536400dac82fde0ef6eca2a34e29d43c8&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=834bcc4de62ed88ee9cc127ef8fbf10536400dac82fde0ef6eca2a34e29d43c8&reaction=dislike'>👎</a>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz commented on code in PR #38809:
URL: https://github.com/apache/superset/pull/38809#discussion_r2981439491


##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx:
##########
@@ -154,6 +154,37 @@ function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
     Boolean(controls?.orientation.value === OrientationType.Vertical);
   const isHorizontal = (controls: ControlStateMapping) =>
     Boolean(controls?.orientation.value === OrientationType.Horizontal);
+  const isNumericColumn = (controls: ControlStateMapping) => {
+    const xAxisColumn = controls?.x_axis?.value;
+    const xAxisOptions = controls?.x_axis?.options;
+    if (!xAxisColumn || !Array.isArray(xAxisOptions)) {
+      return false;
+    }
+    const xAxisType = xAxisOptions.find(
+      (option: { column_name: string; type?: string }) =>
+        option.column_name === xAxisColumn,
+    )?.type;
+    if (typeof xAxisType !== 'string') {
+      return false;
+    }
+    const typeUpper = xAxisType.toUpperCase();
+    if (typeUpper.includes('TIME')) {
+      return false;
+    }
+    return [
+      'INT',
+      'INTEGER',
+      'BIGINT',
+      'SMALLINT',
+      'TINYINT',
+      'FLOAT',
+      'DOUBLE',
+      'REAL',
+      'NUMERIC',
+      'DECIMAL',

Review Comment:
   Instead of this approach, can we do:
     1. Use checkColumnType(column, datasource, [GenericDataType.Numeric]) for number format visibility
     2. Use checkColumnType(column, datasource, [GenericDataType.Temporal]) for time format visibility
     
   There is a precedent in `xAxisForceCategoricalControl` in `packages/superset-ui-chart-controls/src/shared-controls/customControls.tsx`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "EnxDev (via GitHub)" <gi...@apache.org>.
EnxDev commented on code in PR #38809:
URL: https://github.com/apache/superset/pull/38809#discussion_r3000884033


##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx:
##########
@@ -163,7 +177,23 @@ function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
           default: 'smart_date',
           description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
           visibility: ({ controls }: ControlPanelsContainerProps) =>
-            isXAxis ? isVertical(controls) : isHorizontal(controls),
+            (isXAxis ? isVertical(controls) : isHorizontal(controls)) &&
+            !isNumericXAxis(controls),

Review Comment:
   I preferred to leave it like this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "EnxDev (via GitHub)" <gi...@apache.org>.
EnxDev commented on code in PR #38809:
URL: https://github.com/apache/superset/pull/38809#discussion_r2987874168


##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx:
##########
@@ -181,6 +184,32 @@ const config: ControlPanelConfig = {
               ...sharedControls.x_axis_time_format,
               default: 'smart_date',
               description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
+              visibility: ({ controls }: ControlPanelsContainerProps) =>
+                !checkColumnType(
+                  getColumnLabel(
+                    controls?.x_axis?.value as QueryFormColumn,
+                  ),
+                  controls?.datasource?.datasource,
+                  [GenericDataType.Numeric],

Review Comment:
   For the `x_axis_time_format visibility`, it's more semantically correct to check if the column is temporal rather than checking if it's NOT numeric.



##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx:
##########
@@ -111,6 +114,28 @@ const config: ControlPanelConfig = {
               ...sharedControls.x_axis_time_format,
               default: 'smart_date',
               description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
+              visibility: ({ controls }: ControlPanelsContainerProps) =>
+                !checkColumnType(
+                  getColumnLabel(controls?.x_axis?.value as QueryFormColumn),
+                  controls?.datasource?.datasource,
+                  [GenericDataType.Numeric],
+                ),

Review Comment:
   Yeah in the original behavior time format is always shown so we can avoid that



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #38809:
URL: https://github.com/apache/superset/pull/38809#discussion_r2982113995


##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx:
##########
@@ -163,6 +166,28 @@ const config: ControlPanelConfig = {
               ...sharedControls.x_axis_time_format,
               default: 'smart_date',
               description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
+              visibility: ({ controls }: ControlPanelsContainerProps) =>
+                !checkColumnType(
+                  getColumnLabel(controls?.x_axis?.value as QueryFormColumn),
+                  controls?.datasource?.datasource,
+                  [GenericDataType.Numeric],
+                ),
+            },
+          },
+        ],
+        [
+          {
+            name: 'x_axis_number_format',
+            config: {
+              ...sharedControls.x_axis_number_format,
+              default: 'd',

Review Comment:
   **Suggestion:** The numeric X-axis formatter is defaulted to integer format, which will round/truncate decimal X-axis values and display incorrect labels for float columns. Since visibility is based on all numeric columns (not just integers), use a non-integer-preserving default so decimal values are rendered correctly. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Decimal numeric X-axis labels can display inaccurately.
   - ⚠️ Step chart axis readability degrades for float dimensions.
   - ⚠️ Users must manually change formatter to recover precision.
   ```
   </details>
   
   ```suggestion
                 default: '~g',
   ```
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Open a Step timeseries chart and select a FLOAT/DECIMAL column as X-axis;
   `x_axis_number_format` becomes visible because `visibility` calls `checkColumnType(...,
   [GenericDataType.Numeric])` in
   `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx:185-190`.
   
   2. The same control hardcodes `default: 'd'` in
   `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx:183`,
   so numeric X-axis formatting defaults to integer formatting.
   
   3. During rendering, `transformProps` uses numeric formatter path for numeric X-axis
   (`xAxisDataType === GenericDataType.Numeric ? getNumberFormatter(xAxisNumberFormat)`) at
   `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:636-640`.
   
   4. Because FLOAT/DECIMAL columns are included in numeric typing (also validated by numeric
   visibility test cases including FLOAT/DECIMAL in
   `superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Scatter/controlPanel.test.ts:141-149`),
   decimal X values are passed through integer format `d`, causing decimal labels to be
   rounded/truncated.
   ```
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx
   **Line:** 183:183
   **Comment:**
   	*Logic Error: The numeric X-axis formatter is defaulted to integer format, which will round/truncate decimal X-axis values and display incorrect labels for float columns. Since visibility is based on all numeric columns (not just integers), use a non-integer-preserving default so decimal values are rendered correctly.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=dc48f37a9441cb4beceea5e917d78385585d7dbaa6240792100558c80bf64b97&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=dc48f37a9441cb4beceea5e917d78385585d7dbaa6240792100558c80bf64b97&reaction=dislike'>👎</a>



##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx:
##########
@@ -146,6 +149,28 @@ const config: ControlPanelConfig = {
               ...sharedControls.x_axis_time_format,
               default: 'smart_date',
               description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
+              visibility: ({ controls }: ControlPanelsContainerProps) =>
+                !checkColumnType(
+                  getColumnLabel(controls?.x_axis?.value as QueryFormColumn),
+                  controls?.datasource?.datasource,
+                  [GenericDataType.Numeric],
+                ),
+            },
+          },
+        ],
+        [
+          {
+            name: 'x_axis_number_format',
+            config: {
+              ...sharedControls.x_axis_number_format,
+              default: 'd',

Review Comment:
   **Suggestion:** Using `d` as the default numeric X-axis formatter forces integer formatting, which rounds/truncates decimal X-axis values and can produce incorrect tick labels (e.g., `2024.5` becomes `2025`). Use a general numeric formatter that preserves decimals by default. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Decimal numeric X-axis labels can lose precision.
   - ⚠️ Line chart axis labels may misrepresent source values.
   - ⚠️ Affects numeric X-axis in Timeseries transformProps pipeline.
   ```
   </details>
   
   ```suggestion
                 default: '~g',
   ```
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. In
   `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx:163-174`,
   the `x_axis_number_format` control is shown whenever `checkColumnType(...,
   [GenericDataType.Numeric])` is true; this includes float/decimal numeric columns.
   
   2. The same control sets `default: 'd'` at `controlPanel.tsx:166`, so numeric X-axis
   charts default to integer-style formatting without user changes.
   
   3. During render,
   `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:636-640`
   uses `getNumberFormatter(xAxisNumberFormat)` when `xAxisDataType ===
   GenericDataType.Numeric`, so the default formatter is applied directly to X-axis tick
   labels.
   
   4. Numeric non-integer X-axis is a real path: tests already treat `FLOAT`/`DECIMAL` as
   numeric X-axis (e.g.
   `superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Bar/controlPanel.test.ts:18-24`),
   so this path is not hypothetical.
   
   5. Integer formatting drops decimals in practice (see
   `getNumberFormatter(NumberFormats.INTEGER)` formatting `10.1` to `10` in
   `superset-frontend/plugins/plugin-chart-echarts/test/utils/forecast.test.ts:21-32`),
   demonstrating the same class of precision loss risk for integer-style defaults on decimal
   values.
   ```
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx
   **Line:** 166:166
   **Comment:**
   	*Logic Error: Using `d` as the default numeric X-axis formatter forces integer formatting, which rounds/truncates decimal X-axis values and can produce incorrect tick labels (e.g., `2024.5` becomes `2025`). Use a general numeric formatter that preserves decimals by default.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=067d8fd762dcd75290f4d6f81f4d9f7839fc6849e25e86fd618b06cd0c4c19e9&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=067d8fd762dcd75290f4d6f81f4d9f7839fc6849e25e86fd618b06cd0c4c19e9&reaction=dislike'>👎</a>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #38809:
URL: https://github.com/apache/superset/pull/38809#discussion_r3002237545


##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx:
##########
@@ -114,6 +117,22 @@ const config: ControlPanelConfig = {
             },

Review Comment:
   **Suggestion:** The SmoothLine x-axis time format control reuses the shared control without defining a visibility function, so it is always rendered even when the X-axis column is numeric; this both violates the intended behavior (time format should only show for temporal columns) and causes the new tests that expect a `config.visibility` function to fail. You should add a `visibility` predicate using `checkColumnType` with `GenericDataType.Temporal`, mirroring the Step chart configuration, so that the time format control is only visible for temporal X-axis columns and hidden when numeric columns are used. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ SmoothLine control panel unit test fails in CI.
   - ⚠️ SmoothLine X-axis shows time format for numeric columns.
   - ⚠️ Inconsistent X-axis controls vs Line/Area/Step/Scatter.
   ```
   </details>
   
   ```suggestion
                 visibility: ({ controls }: ControlPanelsContainerProps) =>
                   checkColumnType(
                     getColumnLabel(controls?.x_axis?.value as QueryFormColumn),
                     controls?.datasource?.datasource,
                     [GenericDataType.Temporal],
                   ),
   ```
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Open the Explore view for a SmoothLine chart (viz type `VizType.SmoothLine` wired to
   `EchartsTimeseriesSmoothLineChartPlugin` in
   `superset-frontend/src/visualizations/presets/MainPreset.ts`, which in turn uses the
   control panel config from
   `plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx`).
   
   2. In the SmoothLine control panel, assign a numeric column (e.g. an integer `year`
   column) to the X-axis control; the panel reads the X-axis section configuration around the
   `x_axis_time_format` and `x_axis_number_format` controls in `SmoothLine/controlPanel.tsx`
   (lines ~30–55 of the X Axis block).
   
   3. Observe that `x_axis_time_format` has no `config.visibility` in
   `SmoothLine/controlPanel.tsx` (unlike Line, Area, Step, and Scatter where it is guarded
   with `checkColumnType(... [GenericDataType.Temporal])`), so the time format control is
   always rendered, while `x_axis_number_format` is only shown when `checkColumnType(...
   [GenericDataType.Numeric])` passes; in the UI both "X Axis Time Format" and "X Axis Number
   Format" controls are visible for a numeric X-axis, which contradicts the intended behavior
   described in the PR.
   
   4. Run the unit tests for this control panel
   (`superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/SmoothLine/controlPanel.test.ts`);
   the test `"x_axis_time_format should be hidden for numeric columns"` (around lines 70–75
   in that file) does `const visibilityFn = timeFormatControl?.config?.visibility;
   expect(visibilityFn).toBeDefined();` and then calls `visibilityFn(mockControls('year',
   GenericDataType.Numeric))`, which currently fails because `config.visibility` is
   `undefined` for `x_axis_time_format` in `SmoothLine/controlPanel.tsx`.
   ```
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx
   **Line:** 117:117
   **Comment:**
   	*Logic Error: The SmoothLine x-axis time format control reuses the shared control without defining a visibility function, so it is always rendered even when the X-axis column is numeric; this both violates the intended behavior (time format should only show for temporal columns) and causes the new tests that expect a `config.visibility` function to fail. You should add a `visibility` predicate using `checkColumnType` with `GenericDataType.Temporal`, mirroring the Step chart configuration, so that the time format control is only visible for temporal X-axis columns and hidden when numeric columns are used.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=ad27c26e478f9768f161e3c56792207a331ac85540d15cca1657b608e0b2e2da&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38809&comment_hash=ad27c26e478f9768f161e3c56792207a331ac85540d15cca1657b608e0b2e2da&reaction=dislike'>👎</a>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4155094048

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) is building environment on [GHA](https://github.com/apache/superset/actions/runs/23746942780) for [f6de13c](https://github.com/apache/superset/commit/f6de13c)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4154051604

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) is building environment on [GHA](https://github.com/apache/superset/actions/runs/23740889812) for [51f1602](https://github.com/apache/superset/commit/51f1602)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz commented on code in PR #38809:
URL: https://github.com/apache/superset/pull/38809#discussion_r3009117125


##########
superset-frontend/src/core/sqlLab/sqlLab.test.ts:
##########


Review Comment:
   It's weird to have this file edited? I am guessing it's the formatter?



##########
superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx:
##########


Review Comment:
   Same here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz commented on code in PR #38809:
URL: https://github.com/apache/superset/pull/38809#discussion_r3008568082


##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/SmoothLine/controlPanel.test.ts:
##########
@@ -0,0 +1,117 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { ControlPanelsContainerProps } from '@superset-ui/chart-controls/types';
+import { GenericDataType } from '@apache-superset/core/common';
+import controlPanel from '../../../src/Timeseries/Regular/SmoothLine/controlPanel';
+
+const config = controlPanel;
+
+const getControl = (controlName: string) => {
+  for (const section of config.controlPanelSections) {
+    if (section && section.controlSetRows) {
+      for (const row of section.controlSetRows) {
+        for (const control of row) {
+          if (
+            typeof control === 'object' &&
+            control !== null &&
+            'name' in control &&
+            control.name === controlName
+          ) {
+            return control;
+          }
+        }
+      }
+    }
+  }
+
+  return null;
+};
+
+const mockControls = (
+  xAxisColumn: string | null,
+  typeGeneric: GenericDataType | null,
+): ControlPanelsContainerProps => {
+  const columns =
+    xAxisColumn && typeGeneric !== null
+      ? [{ column_name: xAxisColumn, type_generic: typeGeneric }]
+      : [];
+
+  return {
+    controls: {
+      // @ts-expect-error
+      x_axis: {
+        value: xAxisColumn,
+      },
+      // @ts-expect-error
+      datasource: {
+        datasource: { columns },
+      },
+    },
+  };
+};
+
+const timeFormatControl: any = getControl('x_axis_time_format');
+const numberFormatControl: any = getControl('x_axis_number_format');
+
+test('should include x_axis_time_format control', () => {
+  expect(timeFormatControl).toBeDefined();
+  expect(timeFormatControl.config.default).toBe('smart_date');
+});
+
+test('x_axis_time_format should be visible for temporal columns', () => {
+  const visibilityFn = timeFormatControl?.config?.visibility;
+  expect(visibilityFn).toBeDefined();
+  expect(visibilityFn(mockControls('date', GenericDataType.Temporal))).toBe(
+    true,
+  );
+});
+
+test('x_axis_time_format should be hidden for numeric columns', () => {

Review Comment:
   Looks relevant as well



##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/SmoothLine/controlPanel.test.ts:
##########
@@ -0,0 +1,117 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { ControlPanelsContainerProps } from '@superset-ui/chart-controls/types';
+import { GenericDataType } from '@apache-superset/core/common';
+import controlPanel from '../../../src/Timeseries/Regular/SmoothLine/controlPanel';
+
+const config = controlPanel;
+
+const getControl = (controlName: string) => {
+  for (const section of config.controlPanelSections) {
+    if (section && section.controlSetRows) {
+      for (const row of section.controlSetRows) {
+        for (const control of row) {
+          if (
+            typeof control === 'object' &&
+            control !== null &&
+            'name' in control &&
+            control.name === controlName
+          ) {
+            return control;
+          }
+        }
+      }
+    }
+  }
+
+  return null;
+};
+
+const mockControls = (
+  xAxisColumn: string | null,
+  typeGeneric: GenericDataType | null,
+): ControlPanelsContainerProps => {
+  const columns =
+    xAxisColumn && typeGeneric !== null
+      ? [{ column_name: xAxisColumn, type_generic: typeGeneric }]
+      : [];
+
+  return {
+    controls: {
+      // @ts-expect-error
+      x_axis: {
+        value: xAxisColumn,
+      },
+      // @ts-expect-error
+      datasource: {
+        datasource: { columns },
+      },
+    },
+  };
+};
+
+const timeFormatControl: any = getControl('x_axis_time_format');
+const numberFormatControl: any = getControl('x_axis_number_format');
+
+test('should include x_axis_time_format control', () => {
+  expect(timeFormatControl).toBeDefined();
+  expect(timeFormatControl.config.default).toBe('smart_date');
+});
+
+test('x_axis_time_format should be visible for temporal columns', () => {
+  const visibilityFn = timeFormatControl?.config?.visibility;
+  expect(visibilityFn).toBeDefined();
+  expect(visibilityFn(mockControls('date', GenericDataType.Temporal))).toBe(
+    true,
+  );
+});
+
+test('x_axis_time_format should be hidden for numeric columns', () => {

Review Comment:
   Looks relevant as well



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "michaelmorera-preset (via GitHub)" <gi...@apache.org>.
michaelmorera-preset commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4154461288

   The application is working as expected.
   
   # Scenario
   When the x axis isn't a time column, the X Axis Time format field in the Customize tab should instead be a Number format field
   
   ## Steps
   1. Open Explore and select a dataset that has both a time column and a numeric column (for example `cleaned_sales_data`).
   2. Choose Bar Chart as the visualization type.
   3. On the Data tab, set Metric, set X Axis to the time column (e.g. Order Date), then open the Customize tab and the X Axis subsection (Time format).
   4. On the Data tab, change X Axis to a numeric column (e.g. year), then open Customize → X Axis again  (X Axis Number Format).
   
   ## Current  result
   After step 3, under X Axis, the Time format control is shown (and the numeric X-axis format control is not used for that column).
   
   After step 4, under X Axis, Time format is not shown for the numeric column; X Axis Number Format is shown instead, so axis labels follow number formatting rather than time formatting.
   
   ## Variants
   | X Axis - Time format column | Status |
   | -------- | -------- |
   | `%Y-%m-%d` `(2019-01-14)` | :white_check_mark: |
   | `%d-%m-%Y %H:%M:%S` `(14-01-20…)` | :white_check_mark: |
   | `%d.%m.%Y` `(14.01.2019)` | :white_check_mark: |
   | `%d/%m/%Y` `(14/01/2019)` | :white_check_mark: |
   | `%H:%M:%S` `(01:32:10)` | :white_check_mark: |
   | `%m/%d/%Y` `(01/14/2019)` | :white_check_mark: |
   | `%Y-%m-%d %H:%M:%S` `(2019-01-…)` | :white_check_mark: |
   | `Adaptive formatting` | :white_check_mark: |
   
   | X Axis - Number format column | Status |
   | -------- | -------- |
   | `Original value` | :white_check_mark: |
   | `,.1%` `(12345.432 => 1,234,543.2%)` | :white_check_mark: |
   | `,.1f` `(12345.432 => 12,345.4)` | :white_check_mark: |
   | `,.2f` `(12345.432 => 12,345.43)` | :white_check_mark: |
   | `,.3f` `(12345.432 => 12,345.432)` | :white_check_mark: |
   | `,d` `(12345.432 => 12,345)` | :white_check_mark: |
   | `.1s` `(12345.432 => 10k)` | :white_check_mark: |
   | `.2%` `(12345.432 => 1234543.20%)` | :white_check_mark: |
   | `.3%` `(12345.432 => 1234543.200%)` | :white_check_mark: |
   | `.3s` `(12345.432 => 12.3k)` | :white_check_mark: |
   | `.4r` `(12345.432 => 12350)` | :white_check_mark: |
   | `+,` `(12345.432 => +12,345)` | :white_check_mark: |
   | `$,.2f` `(12345.432 => $12,345.43)` | :white_check_mark: |
   | `Adaptive formatting` | :white_check_mark: |
   | `Duration in ms` `(1.40008 => 1ms 400µ…)` | :white_check_mark: |
   | `Duration in ms` `(10500 => 0:10.5)` | :white_check_mark: |
   | `Duration in ms (66000 => 1m 6s)` | :white_check_mark: |
   | `Memory in bytes - binary (1024B => 1KiB)` | :white_check_mark: |
   | `Memory in bytes - decimal (1024B => 1.024kB)` | :white_check_mark: |
   | `Memory transfer rate in bytes - binary (1024B => 1KiB/s)` | :white_check_mark: |
   | `Memory transfer rate in bytes - decimal (1024B => 1.024kB/s)` | :white_check_mark: |
   
   ## Evidence
   ### Before/after
   ![YearasnumberXAxisbeforeandafter](https://github.com/user-attachments/assets/1e544ed2-23d8-4d60-ba3f-f64b7b9d1998)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4154151085

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) deployed environment on [GHA](https://github.com/apache/superset/actions/runs/23740889812) for [51f1602](https://github.com/apache/superset/commit/51f1602)
   
   • **Environment:** http://16.146.5.22:8080 (admin/admin)
   • **Lifetime:** 48h auto-cleanup
   • **Updates:** New commits create fresh environments automatically


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz commented on code in PR #38809:
URL: https://github.com/apache/superset/pull/38809#discussion_r3000624372


##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx:
##########
@@ -163,7 +177,23 @@ function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
           default: 'smart_date',
           description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
           visibility: ({ controls }: ControlPanelsContainerProps) =>
-            isXAxis ? isVertical(controls) : isHorizontal(controls),
+            (isXAxis ? isVertical(controls) : isHorizontal(controls)) &&
+            !isNumericXAxis(controls),

Review Comment:
   Hey @EnxDev any input on this?



##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx:
##########
@@ -163,6 +166,28 @@ const config: ControlPanelConfig = {
               ...sharedControls.x_axis_time_format,
               default: 'smart_date',
               description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
+              visibility: ({ controls }: ControlPanelsContainerProps) =>
+                !checkColumnType(
+                  getColumnLabel(controls?.x_axis?.value as QueryFormColumn),
+                  controls?.datasource?.datasource,
+                  [GenericDataType.Numeric],
+                ),
+            },
+          },
+        ],
+        [
+          {
+            name: 'x_axis_number_format',
+            config: {
+              ...sharedControls.x_axis_number_format,
+              default: 'd',

Review Comment:
   This also seems relevant @EnxDev 



##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/SmoothLine/controlPanel.test.ts:
##########
@@ -0,0 +1,125 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { ControlPanelsContainerProps } from '@superset-ui/chart-controls/types';
+import { GenericDataType } from '@apache-superset/core/common';
+import controlPanel from '../../../src/Timeseries/Regular/SmoothLine/controlPanel';
+
+const config = controlPanel;
+
+const getControl = (controlName: string) => {
+  for (const section of config.controlPanelSections) {
+    if (section && section.controlSetRows) {
+      for (const row of section.controlSetRows) {
+        for (const control of row) {
+          if (
+            typeof control === 'object' &&
+            control !== null &&
+            'name' in control &&
+            control.name === controlName
+          ) {
+            return control;
+          }
+        }
+      }
+    }
+  }
+
+  return null;
+};
+
+const mockControls = (
+  xAxisColumn: string | null,
+  typeGeneric: GenericDataType | null,
+): ControlPanelsContainerProps => {
+  const columns =
+    xAxisColumn && typeGeneric !== null
+      ? [{ column_name: xAxisColumn, type_generic: typeGeneric }]
+      : [];
+
+  return {
+    controls: {
+      // @ts-expect-error
+      x_axis: {
+        value: xAxisColumn,
+      },
+      // @ts-expect-error
+      datasource: {
+        datasource: { columns },
+      },
+    },
+  };
+};
+
+const timeFormatControl: any = getControl('x_axis_time_format');
+const numberFormatControl: any = getControl('x_axis_number_format');
+
+test('should include x_axis_time_format control', () => {
+  expect(timeFormatControl).toBeDefined();
+  expect(timeFormatControl.config.default).toBe('smart_date');
+});
+
+test('x_axis_time_format should be visible for temporal columns', () => {
+  const visibilityFn = timeFormatControl?.config?.visibility;
+  if (visibilityFn) {
+    expect(visibilityFn(mockControls('date', GenericDataType.Temporal))).toBe(
+      true,
+    );
+  } else {
+    // no visibility function means always visible
+    expect(true).toBe(true);
+  }

Review Comment:
   Let's not do `expect(true).toBe(true)`



##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/SmoothLine/controlPanel.test.ts:
##########
@@ -0,0 +1,125 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { ControlPanelsContainerProps } from '@superset-ui/chart-controls/types';
+import { GenericDataType } from '@apache-superset/core/common';
+import controlPanel from '../../../src/Timeseries/Regular/SmoothLine/controlPanel';
+
+const config = controlPanel;
+
+const getControl = (controlName: string) => {
+  for (const section of config.controlPanelSections) {
+    if (section && section.controlSetRows) {
+      for (const row of section.controlSetRows) {
+        for (const control of row) {
+          if (
+            typeof control === 'object' &&
+            control !== null &&
+            'name' in control &&
+            control.name === controlName
+          ) {
+            return control;
+          }
+        }
+      }
+    }
+  }
+
+  return null;
+};
+
+const mockControls = (
+  xAxisColumn: string | null,
+  typeGeneric: GenericDataType | null,
+): ControlPanelsContainerProps => {
+  const columns =
+    xAxisColumn && typeGeneric !== null
+      ? [{ column_name: xAxisColumn, type_generic: typeGeneric }]
+      : [];
+
+  return {
+    controls: {
+      // @ts-expect-error
+      x_axis: {
+        value: xAxisColumn,
+      },
+      // @ts-expect-error
+      datasource: {
+        datasource: { columns },
+      },
+    },
+  };
+};
+
+const timeFormatControl: any = getControl('x_axis_time_format');
+const numberFormatControl: any = getControl('x_axis_number_format');
+
+test('should include x_axis_time_format control', () => {
+  expect(timeFormatControl).toBeDefined();
+  expect(timeFormatControl.config.default).toBe('smart_date');
+});
+
+test('x_axis_time_format should be visible for temporal columns', () => {
+  const visibilityFn = timeFormatControl?.config?.visibility;
+  if (visibilityFn) {
+    expect(visibilityFn(mockControls('date', GenericDataType.Temporal))).toBe(
+      true,
+    );
+  } else {
+    // no visibility function means always visible
+    expect(true).toBe(true);
+  }
+});
+
+test('x_axis_time_format should be visible for numeric columns', () => {
+  const visibilityFn = timeFormatControl?.config?.visibility;
+  if (visibilityFn) {
+    expect(visibilityFn(mockControls('year', GenericDataType.Numeric))).toBe(
+      true,
+    );
+  } else {
+    // no visibility function means always visible
+    expect(true).toBe(true);
+  }

Review Comment:
   Here as well



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4112927747

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4130219478

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4119262493

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4112957777

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | 0f651228302e67e1489687ae1b19388a46424507 |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/69c18ab904d60e0008c44a8d |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-38809--superset-docs-preview.netlify.app](https://deploy-preview-38809--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTM4ODA5LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.D2bnXqzbu2J6rjFLrzJioUkq5QOc2r8X4OxuSLhau5A)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-38809--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4156200597

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/38809?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `95.23810%` with `1 line` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 64.48%. Comparing base ([`15bab22`](https://app.codecov.io/gh/apache/superset/commit/15bab227bb00f34ab4b4bb87844f0916e839953a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`a4cc1ed`](https://app.codecov.io/gh/apache/superset/commit/a4cc1ed475fb08acc0bdc905ff232c7ecc71429e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/38809?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...src/Timeseries/Regular/SmoothLine/controlPanel.tsx](https://app.codecov.io/gh/apache/superset/pull/38809?src=pr&el=tree&filepath=superset-frontend%2Fplugins%2Fplugin-chart-echarts%2Fsrc%2FTimeseries%2FRegular%2FSmoothLine%2FcontrolPanel.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvVGltZXNlcmllcy9SZWd1bGFyL1Ntb290aExpbmUvY29udHJvbFBhbmVsLnRzeA==) | 50.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/38809?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #38809   +/-   ##
   =======================================
     Coverage   64.48%   64.48%           
   =======================================
     Files        2536     2536           
     Lines      130862   130858    -4     
     Branches    30358    30359    +1     
   =======================================
   - Hits        84387    84385    -2     
   + Misses      45012    45010    -2     
     Partials     1463     1463           
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/38809/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/38809/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `65.83% <95.23%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/38809?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "EnxDev (via GitHub)" <gi...@apache.org>.
EnxDev commented on PR #38809:
URL: https://github.com/apache/superset/pull/38809#issuecomment-4142376923

   > Hey @EnxDev any input on this?
   I preferred to leave it like this.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "EnxDev (via GitHub)" <gi...@apache.org>.
EnxDev commented on code in PR #38809:
URL: https://github.com/apache/superset/pull/38809#discussion_r3001292475


##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx:
##########
@@ -163,6 +166,28 @@ const config: ControlPanelConfig = {
               ...sharedControls.x_axis_time_format,
               default: 'smart_date',
               description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
+              visibility: ({ controls }: ControlPanelsContainerProps) =>
+                !checkColumnType(
+                  getColumnLabel(controls?.x_axis?.value as QueryFormColumn),
+                  controls?.datasource?.datasource,
+                  [GenericDataType.Numeric],
+                ),
+            },
+          },
+        ],
+        [
+          {
+            name: 'x_axis_number_format',
+            config: {
+              ...sharedControls.x_axis_number_format,
+              default: 'd',

Review Comment:
   yes, I've replaced `d` with `~g` to preserves original precision



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(charts): add X Axis Number Format control for numeric X-axis columns [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #38809:
URL: https://github.com/apache/superset/pull/38809#discussion_r3002588190


##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/SmoothLine/controlPanel.test.ts:
##########
@@ -0,0 +1,117 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { ControlPanelsContainerProps } from '@superset-ui/chart-controls/types';
+import { GenericDataType } from '@apache-superset/core/common';
+import controlPanel from '../../../src/Timeseries/Regular/SmoothLine/controlPanel';
+
+const config = controlPanel;
+
+const getControl = (controlName: string) => {
+  for (const section of config.controlPanelSections) {
+    if (section && section.controlSetRows) {
+      for (const row of section.controlSetRows) {
+        for (const control of row) {
+          if (
+            typeof control === 'object' &&
+            control !== null &&
+            'name' in control &&
+            control.name === controlName
+          ) {
+            return control;
+          }
+        }
+      }
+    }
+  }
+
+  return null;
+};
+
+const mockControls = (
+  xAxisColumn: string | null,
+  typeGeneric: GenericDataType | null,
+): ControlPanelsContainerProps => {
+  const columns =
+    xAxisColumn && typeGeneric !== null
+      ? [{ column_name: xAxisColumn, type_generic: typeGeneric }]
+      : [];
+
+  return {
+    controls: {
+      // @ts-expect-error
+      x_axis: {
+        value: xAxisColumn,
+      },
+      // @ts-expect-error
+      datasource: {
+        datasource: { columns },
+      },
+    },
+  };
+};
+
+const timeFormatControl: any = getControl('x_axis_time_format');
+const numberFormatControl: any = getControl('x_axis_number_format');
+
+test('should include x_axis_time_format control', () => {
+  expect(timeFormatControl).toBeDefined();
+  expect(timeFormatControl.config.default).toBe('smart_date');
+});
+
+test('x_axis_time_format should be visible for temporal columns', () => {
+  const visibilityFn = timeFormatControl?.config?.visibility;
+  expect(visibilityFn).toBeDefined();
+  expect(visibilityFn(mockControls('date', GenericDataType.Temporal))).toBe(
+    true,
+  );
+});
+
+test('x_axis_time_format should be hidden for numeric columns', () => {

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing visibility function</b></div>
   <div id="fix">
   
   The test update assumes the visibility function for x_axis_time_format is always defined, but the SmoothLine controlPanel does not include a visibility property for this control, unlike equivalent controls in Line, Scatter, and Bar chart types. This inconsistency will cause the test to fail at runtime since visibilityFn will be undefined. To resolve, either add visibility logic to the controlPanel or modify the test to handle the undefined case.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #a93e61</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org