conglei closed pull request #5281: [SQL lab] Fixed limit issue
URL: https://github.com/apache/incubator-superset/pull/5281
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py
index 35b64d61d9..d7d1b66db6 100644
--- a/superset/db_engine_specs.py
+++ b/superset/db_engine_specs.py
@@ -114,8 +114,7 @@ def get_limit_from_sql(cls, sql):
                 (?ix)          # case insensitive, verbose
                 \s+            # whitespace
                 LIMIT\s+(\d+)  # LIMIT $ROWS
-                ;?             # optional semi-colon
-                (\s|;)*$       # remove trailing spaces tabs or semicolons
+                (\s|;|.)*$     # remove the reset of the chars
                 """)
         matches = limit_pattern.findall(sql)
         if matches:
@@ -127,8 +126,7 @@ def get_query_without_limit(cls, sql):
                 (?ix)        # case insensitive, verbose
                 \s+          # whitespace
                 LIMIT\s+\d+  # LIMIT $ROWS
-                ;?           # optional semi-colon
-                (\s|;)*$     # remove trailing spaces tabs or semicolons
+                (\s|;|.)*$   # remove the reset of the chars
                 """, '', sql)
 
     @staticmethod


 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to