bito-code-review[bot] commented on code in PR #36760:
URL: https://github.com/apache/superset/pull/36760#discussion_r2642208726
##########
superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricOption.tsx:
##########
@@ -18,12 +18,32 @@
*/
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
+import { Metric } from '@superset-ui/core';
import { OptionControlLabel } from
'src/explore/components/controls/OptionControls';
import { DndItemType } from 'src/explore/components/DndItemType';
+import { Datasource } from 'src/explore/types';
+import { ISaveableDatasource } from 'src/SqlLab/components/SaveDatasetModal';
import columnType from './columnType';
import AdhocMetric from './AdhocMetric';
import savedMetricType from './savedMetricType';
import AdhocMetricPopoverTrigger from './AdhocMetricPopoverTrigger';
+import { savedMetricType as SavedMetricTypeDef } from './types';
+
+interface AdhocMetricOptionProps {
+ adhocMetric: AdhocMetric;
+ onMetricEdit: (newMetric: Metric, oldMetric: Metric) => void;
+ onRemoveMetric?: (index: number) => void;
+ columns?: { column_name: string; type: string }[];
+ savedMetricsOptions?: SavedMetricTypeDef[];
+ savedMetric?: SavedMetricTypeDef | Record<string, never>;
Review Comment:
<!-- Bito Reply -->
Yes, your explanation is accurate. In TypeScript, `Record<string, never>`
precisely types an empty object `{}`, matching the JavaScript default behavior
without introducing properties.
--
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]