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


##########
superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricOption.tsx:
##########
@@ -58,7 +78,7 @@ class AdhocMetricOption extends PureComponent {
       onMetricEdit,
       columns,
       savedMetricsOptions,
-      savedMetric,
+      savedMetric = {} as SavedMetricTypeDef,

Review Comment:
   Defaulting to `{}` matches the original JavaScript behavior. Components 
conditionally render based on whether the savedMetric has properties - this is 
checked with patterns like `Object.keys(savedMetric).length > 0`. An empty 
object correctly triggers the "no saved metric" code path.



##########
superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricPopoverTrigger.tsx:
##########
@@ -216,12 +216,12 @@ class AdhocMetricPopoverTrigger extends PureComponent<
           adhocMetric={adhocMetric}
           columns={columns}
           savedMetricsOptions={savedMetricsOptions}
-          savedMetric={savedMetric}
-          datasource={datasource}
+          savedMetric={savedMetric as savedMetricType}

Review Comment:
   Same pattern as other documented technical debt in this migration. The type 
assertion is needed because the component receives props from parent components 
that pass either a typed `savedMetric` or an empty object. The `eslint-disable` 
comment documents this as intentional for migration scope.



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