hlteoh37 commented on code in PR #25548:
URL: https://github.com/apache/flink/pull/25548#discussion_r1819083958


##########
flink-runtime-web/web-dashboard/src/app/components/dagre/components/node/node.component.ts:
##########
@@ -82,7 +84,7 @@ export class NodeComponent {
   }
 
   isValid = (value?: number): boolean => {
-    return value === undefined || value === 0 || isNaN(value);
+    return !!value || value === undefined || value === 0 || isNaN(value);

Review Comment:
   We need to check for undefined, as there has been changes in TS to make it 
such that we cannot pass `undefined` into `isNaN`.
   
   [CI 
link](https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=63355&view=logs&j=52b61abe-a3cc-5bde-cc35-1bbe89bb7df5&t=54421a62-0c80-5aad-3319-094ff69180bb)
   ```
   13:14:46.202 [INFO] Error: 
src/app/components/dagre/components/node/node.component.ts:87:44 - error 
TS2345: Argument of type 'number | undefined' is not assignable to parameter of 
type 'number'.
   13:14:46.202 [INFO]   Type 'undefined' is not assignable to type 'number'.
   13:14:46.202 [INFO] 
   13:14:46.202 [INFO] 87     return !!value || value === 0 || isNaN(value);
   ```
   
   We should be ok with `undefined` being valid as we handle it in the 
`prettyPrint()`
   
   
https://github.com/apache/flink/blob/master/flink-runtime-web/web-dashboard/src/app/components/dagre/components/node/node.component.ts#L166-L172



-- 
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: issues-unsubscr...@flink.apache.org

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

Reply via email to