[fix] Adding space after -- for SQL comments (#7897)

This commit is contained in:
John Bodley
2019-07-18 13:17:26 -07:00
committed by GitHub
parent fce11665f4
commit ccedbea506
2 changed files with 5 additions and 5 deletions

View File

@@ -449,13 +449,13 @@ class SupersetTestCase(unittest.TestCase):
self.assertEquals({"SalesOrderHeader"}, self.extract_tables(query))
def test_get_query_with_new_limit_comment(self):
sql = "SELECT * FROM ab_user --SOME COMMENT"
sql = "SELECT * FROM ab_user -- SOME COMMENT"
parsed = sql_parse.ParsedQuery(sql)
newsql = parsed.get_query_with_new_limit(1000)
self.assertEquals(newsql, sql + "\nLIMIT 1000")
def test_get_query_with_new_limit_comment_with_limit(self):
sql = "SELECT * FROM ab_user --SOME COMMENT WITH LIMIT 555"
sql = "SELECT * FROM ab_user -- SOME COMMENT WITH LIMIT 555"
parsed = sql_parse.ParsedQuery(sql)
newsql = parsed.get_query_with_new_limit(1000)
self.assertEquals(newsql, sql + "\nLIMIT 1000")