ktmud commented on a change in pull request #17202:
URL: https://github.com/apache/superset/pull/17202#discussion_r745111750



##########
File path: 
superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.jsx
##########
@@ -337,6 +341,13 @@ export default class AdhocMetricEditPopover extends 
React.PureComponent {
       ) &&
         savedMetric?.metric_name !== propsSavedMetric?.metric_name);
 
+    let extra = {};
+    if (datasource?.extra) {
+      try {
+        extra = JSON.parse(datasource.extra);
+      } catch {} // eslint-disable-line no-empty
+    }

Review comment:
       The point was having the API return a JSON object so this "pattern" does 
not need to be repeated everywhere `extra` is needed.




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