graceguo-supercat commented on a change in pull request #5241: [Explore] Handle 
empty metrics control data
URL: 
https://github.com/apache/incubator-superset/pull/5241#discussion_r196586597
 
 

 ##########
 File path: 
superset/assets/src/explore/components/controls/AdhocFilterControl.jsx
 ##########
 @@ -223,7 +223,7 @@ export default class AdhocFilterControl extends 
React.Component {
       } else if (option instanceof AdhocMetric) {
         return { ...option, filterOptionName: '_adhocmetric_' + option.label };
       }
-      return null;
+      return '';
 
 Review comment:
   The caller for these 2 `optionsForSelect` functions expecting a string array 
result, but don't handle `null`. if caller brought result to do sort other 
exception will throw.
   
   i come up another solution that combines filter (empty metrics) + map. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to