villebro commented on code in PR #22292:
URL: https://github.com/apache/superset/pull/22292#discussion_r1036799197


##########
superset-frontend/src/utils/common.js:
##########
@@ -86,7 +86,7 @@ export function prepareCopyToClipboardTabularData(data, 
columns) {
       // JavaScript does not maintain the order of a mixed set of keys (i.e 
integers and strings)
       // the below function orders the keys based on the column names.
       const key = columns[j].name || columns[j];
-      if (key in data[i]) {
+      if (data[i][key] === undefined || data[i][key] === null) {

Review Comment:
   as we are referencing `data[i][key]` three times, can we first assign it to 
a variable? Also, we have a helper function `isDefined` which we could use. So 
something like this:
   ```javascript
   const value = data[i][key];
   if (isDefined(value) {
     ...
   }
   ```



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