mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
feat: Logic added to limiting factor column in Query model (#13521)
* Sqllab limit * Add migration script * Set default values * initial push * revisions * Update superset/views/core.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * moving migration to separate PR * with migration * revisions * Fix apply_limit_to_sql * all but tests * added unit tests * revisions * Update superset/sql_lab.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * Update superset/sql_parse.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * fixed black issue * Update superset/views/core.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * updated logic Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
This commit is contained in:
@@ -81,6 +81,19 @@ class TestDbEngineSpecs(TestDbEngineSpec):
|
||||
"SELECT * FROM (SELECT * FROM a LIMIT 10) LIMIT 1000",
|
||||
)
|
||||
|
||||
def test_limit_query_without_force(self):
|
||||
self.sql_limit_regex(
|
||||
"SELECT * FROM a LIMIT 10", "SELECT * FROM a LIMIT 10", limit=11,
|
||||
)
|
||||
|
||||
def test_limit_query_with_force(self):
|
||||
self.sql_limit_regex(
|
||||
"SELECT * FROM a LIMIT 10",
|
||||
"SELECT * FROM a LIMIT 11",
|
||||
limit=11,
|
||||
force=True,
|
||||
)
|
||||
|
||||
def test_limit_with_expr(self):
|
||||
self.sql_limit_regex(
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user