justinpark commented on code in PR #23378:
URL: https://github.com/apache/superset/pull/23378#discussion_r1145452844


##########
superset-frontend/src/SqlLab/actions/sqlLab.js:
##########
@@ -331,6 +331,12 @@ export function fetchQueryResults(query, displayLimit) {
   };
 }
 
+export function cleanSqlComments(sql) {
+  if (!sql) return '';
+
+  return sql.replace(/(\/\*[^*]*\*\/)|(\/\/[^*]*)|(--[^.].*)/gm, '').trim();

Review Comment:
   According to the current editor inspection, it won't accept the group 2 
style `//`.
   I'll update to clean up both cases of `/* */` and `--`
   
   <img width="464" alt="Screenshot 2023-03-22 at 2 59 45 PM" 
src="https://user-images.githubusercontent.com/1392866/227048298-08677bf1-b065-44ed-8715-e04aee358f2c.png";>
   



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