villebro commented on a change in pull request #18746:
URL: https://github.com/apache/superset/pull/18746#discussion_r810639454



##########
File path: superset/models/core.py
##########
@@ -488,7 +488,13 @@ def select_star(  # pylint: disable=too-many-arguments
     def apply_limit_to_sql(
         self, sql: str, limit: int = 1000, force: bool = False
     ) -> str:
-        return self.db_engine_spec.apply_limit_to_sql(sql, limit, self, 
force=force)
+        if self.db_engine_spec.allow_limit_clause:
+            return self.db_engine_spec.apply_limit_to_sql(sql, limit, self, 
force=force)
+        else:
+            return self.db_engine_spec.apply_top_to_sql(sql, limit)
+
+    def apply_top_to_sql(self, sql: str, limit: int = 1000, force: bool = 
False) -> str:

Review comment:
       I don't think this is needed anymore

##########
File path: superset/sql_lab.py
##########
@@ -290,9 +290,12 @@ def execute_sql_statement(  # pylint: 
disable=too-many-arguments,too-many-locals
 def apply_limit_if_exists(
     database: Database, increased_limit: Optional[int], query: Query, sql: str
 ) -> str:
+    print("apply_limit_if_exists")
+    print(database.db_engine_spec.allow_limit_clause)

Review comment:
       please remove these

##########
File path: superset/db_engine_specs/base.py
##########
@@ -80,7 +80,6 @@
 
 logger = logging.getLogger()
 
-

Review comment:
       removed newline seems to still be here

##########
File path: superset/sql_parse.py
##########
@@ -41,7 +50,6 @@
 CTE_PREFIX = "CTE__"
 logger = logging.getLogger(__name__)
 
-

Review comment:
       removed line seems to still be here




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