You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/05/11 07:44:37 UTC

[GitHub] [incubator-superset] villebro commented on a change in pull request #7485: Break line before LIMIT statement to prevent trailing comment issue

villebro commented on a change in pull request #7485: Break line before LIMIT statement to prevent trailing comment issue
URL: https://github.com/apache/incubator-superset/pull/7485#discussion_r283078360
 
 

 ##########
 File path: superset/sql_parse.py
 ##########
 @@ -168,7 +168,7 @@ def get_query_with_new_limit(self, new_limit):
         """returns the query with the specified limit"""
         """does not change the underlying query"""
         if not self._limit:
-            return self.sql + ' LIMIT ' + str(new_limit)
+            return f'{self.sql}\nLIMIT {new_limit}'
 
 Review comment:
   LGTM, just thinking if using `sqlparse` native functionality might be feasible here, ie. `sqlparse.format(self.sql, strip_comments=True)`?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org