mistercrunch commented on a change in pull request #7720: [SQL Lab] Add JSON 
modal when clicking on cells with JSON objects
URL: 
https://github.com/apache/incubator-superset/pull/7720#discussion_r294614422
 
 

 ##########
 File path: superset/assets/src/components/FilterableTable/FilterableTable.jsx
 ##########
 @@ -266,6 +325,15 @@ export default class FilterableTable extends 
PureComponent {
     );
   }
 
+  renderTableCell({ cellData }) {
+    const cellNode = String(cellData);
+    const jsonObject = getJsonStringifiedObject(cellData);
 
 Review comment:
   Given that this will run for each cell (easily hundreds of thousands of 
times), I'm worried that trying `JSON.parse` might be expensive.
   
   Doing a cheap proxy first like:
   ```javascript
   cheapCouldBeJson(value) {
       return (typeof(value) === 'string' && ['{', '[', 
'"'].indexOf(value.substring(0, 1)))
   }
   ```

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