zhaoyongjie commented on code in PR #20338:
URL: https://github.com/apache/superset/pull/20338#discussion_r915651195
##########
superset-frontend/packages/superset-ui-core/test/query/types/Metric.test.ts:
##########
@@ -48,9 +49,9 @@ test('isSavedMetric returns true', () => {
});
test('isSavedMetric returns false', () => {
- expect(isSavedMetric(adhocMetricSQL)).toEqual(false);
- expect(isSavedMetric(null)).toEqual(false);
- expect(isSavedMetric(undefined)).toEqual(false);
+ expect(isSavedMetric(adhocMetricSQL as QueryFormMetric)).toEqual(false);
+ expect(isSavedMetric(null as unknown as QueryFormMetric)).toEqual(false);
+ expect(isSavedMetric(undefined as unknown as
QueryFormMetric)).toEqual(false);
Review Comment:
the type of argument(metric) is any, so no needs as `QueryFormMetric`
```
export function isSavedMetric(metric: any): metric is SavedMetric {
return typeof metric === 'string';
}
```
--
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]