codeant-ai-for-open-source[bot] commented on code in PR #36389:
URL: https://github.com/apache/superset/pull/36389#discussion_r2583608986


##########
superset-frontend/plugins/plugin-chart-echarts/src/Histogram/Histogram.tsx:
##########
@@ -55,6 +56,7 @@ export default function Histogram(props: 
HistogramTransformedProps) {
       width={width}
       echartOptions={echartOptions}
       eventHandlers={eventHandlers}
+      vizType={formData.vizType}

Review Comment:
   **Suggestion:** The code passes `formData.vizType` into the `Echart` 
component, but in Superset form data the visualization type is stored under 
`viz_type`, so this will always be `undefined` and prevent theme overrides (or 
any vizType-dependent behavior) from working for the histogram chart. [logic 
error]
   
   **Severity Level:** Minor ⚠️
   ```suggestion
         vizType={formData.viz_type}
   ```
   <details>
   <summary><b>Why it matters? ⭐ </b></summary>
   
   In Superset, the visualization type on form data is consistently exposed as 
`viz_type` (see `ChartRenderer` using `currentFormData.viz_type`), not 
`vizType`. Passing `formData.vizType` will therefore be `undefined` at runtime 
for standard formData objects, which breaks any behavior in `Echart` that 
depends on a valid `vizType` (theme overrides, behavior flags, etc.). Changing 
this to `formData.viz_type` directly addresses a concrete logic bug introduced 
by the PR, rather than being a cosmetic tweak.
   </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/Histogram/Histogram.tsx
   **Line:** 59:59
   **Comment:**
        *Logic Error: The code passes `formData.vizType` into the `Echart` 
component, but in Superset form data the visualization type is stored under 
`viz_type`, so this will always be `undefined` and prevent theme overrides (or 
any vizType-dependent behavior) from working for the histogram chart.
   
   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>



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to