LevisNgigi commented on code in PR #35009:
URL: https://github.com/apache/superset/pull/35009#discussion_r2622611314


##########
superset/sqllab/query_render.py:
##########
@@ -66,6 +66,19 @@ def render(self, execution_context: SqlJsonExecutionContext) 
-> str:
         except TemplateError as ex:
             self._raise_template_exception(ex, execution_context)
             return "NOT_REACHABLE_CODE"
+        except Exception as ex:
+            from superset.jinja_context import 
UndefinedTemplateFunctionException
+
+            if isinstance(ex, UndefinedTemplateFunctionException):
+                return query_model.sql.strip().strip(";")
+            raise
+
+    def _strip_sql_comments(self, sql: str) -> str:
+        import re
+
+        sql = re.sub(r"/\*.*?\*/", "", sql, flags=re.DOTALL)
+        sql = re.sub(r"--[^\n\r]*", "", sql)
+        return sql

Review Comment:
   Okay I have adressed this



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