rusackas commented on code in PR #37107:
URL: https://github.com/apache/superset/pull/37107#discussion_r2729433422


##########
superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx:
##########
@@ -305,8 +305,10 @@ function mapDispatchToProps(
   dispatch: ThunkDispatch<any, undefined, AnyAction>,
 ) {
   return {
-    refreshAnnotationData: (annotationObj: Annotation) =>
-      dispatch(runAnnotationQuery(annotationObj)),
+    refreshAnnotationData: (payload: Payload) =>
+      dispatch(
+        runAnnotationQuery(payload as Parameters<typeof 
runAnnotationQuery>[0]),
+      ),

Review Comment:
   Valid concern. This is a pre-existing type mismatch that was hidden by 
JavaScript's lack of type checking. The local `Annotation` interface has 
`annotation: string`, but `runAnnotationQuery` expects `annotation: 
AnnotationLayerWithOverrides`.
   
   The cast is necessary to preserve existing runtime behavior during this 
TypeScript migration. I've added an explanatory comment documenting this as 
technical debt to be addressed separately. Attempting to 'fix' the types 
without understanding all the call sites could introduce bugs.



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