villebro commented on issue #4412: Comment row at end of query in SQL Lab fails 
to render in Explore window
URL: 
https://github.com/apache/incubator-superset/issues/4412#issuecomment-365210867
 
 
   Right you are, I missed that. New try:
   
   ```
   diff --git a/superset/connectors/sqla/models.py 
b/superset/connectors/sqla/models.py
   index b2e21c7d..9e2ae200 100644
   --- a/superset/connectors/sqla/models.py
   +++ b/superset/connectors/sqla/models.py
   @@ -428,6 +428,7 @@ class SqlaTable(Model, BaseDatasource):
                    from_sql = template_processor.process_template(from_sql)
                if db_engine_spec:
                    from_sql = db_engine_spec.escape_sql(from_sql)
   +            from_sql = sqlparse.format(from_sql, strip_comments=True)
                return TextAsFrom(sa.text(from_sql), []).alias('expr_qry')
            return self.get_sqla_table()
   
   ```

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to