korbit-ai[bot] commented on code in PR #35179:
URL: https://github.com/apache/superset/pull/35179#discussion_r2356864921


##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:
##########
@@ -582,9 +582,21 @@ export default function transformProps(
           richTooltip,
           tooltipSortByMetric,
         );
+        const filteredForecastValue = forecastValue.filter(
+          (item: any) =>
+            !annotationLayers.some(
+              (annotation: any) => item.seriesName === annotation.name,
+            ),
+        );

Review Comment:
   ### Avoid 'any' Type Usage <sub>![category 
Design](https://img.shields.io/badge/Design-0d9488)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The code uses 'any' type annotations which bypasses TypeScript's type 
checking system.
   
   
   ###### Why this matters
   Using 'any' defeats TypeScript's type safety features and can lead to 
runtime errors that could have been caught during compilation.
   
   ###### Suggested change ∙ *Feature Preview*
   Define proper interfaces for the item and annotation objects:
   ```typescript
   interface ForecastItem {
     seriesName: string;
     // add other required properties
   }
   
   interface AnnotationLayer {
     name: string;
     // add other required properties
   }
   
   const filteredForecastValue = forecastValue.filter(
     (item: ForecastItem) =>
       !annotationLayers.some(
         (annotation: AnnotationLayer) => item.seriesName === annotation.name,
       ),
   );
   ```
   
   
   ###### Provide feedback to improve future suggestions
   [![Nice 
Catch](https://img.shields.io/badge/👍%20Nice%20Catch-71BC78)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/570e3be6-2372-48a3-866f-90fdddabaee6/upvote)
 
[![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/570e3be6-2372-48a3-866f-90fdddabaee6?what_not_true=true)
  [![Not in 
Scope](https://img.shields.io/badge/👎%20Out%20of%20PR%20scope-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/570e3be6-2372-48a3-866f-90fdddabaee6?what_out_of_scope=true)
 [![Not in coding 
standard](https://img.shields.io/badge/👎%20Not%20in%20our%20standards-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/570e3be6-2372-48a3-866f-90fdddabaee6?what_not_in_standard=true)
 
[![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/570e3be6-2372-48a3-866f-90fdddabaee6)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:abe2a252-782c-460b-a061-60b20ce32588 -->
   
   
   [](abe2a252-782c-460b-a061-60b20ce32588)



-- 
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