mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore: improve SQL parsing (#26767)
This commit is contained in:
@@ -138,8 +138,8 @@ def get_select_star(table: str, limit: int, schema: Optional[str] = None):
|
||||
schema = quote_f(schema)
|
||||
table = quote_f(table)
|
||||
if schema:
|
||||
return f"SELECT *\nFROM {schema}.{table}\nLIMIT {limit}"
|
||||
return f"SELECT *\nFROM {table}\nLIMIT {limit}"
|
||||
return f"SELECT\n *\nFROM {schema}.{table}\nLIMIT {limit}"
|
||||
return f"SELECT\n *\nFROM {table}\nLIMIT {limit}"
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("login_as_admin")
|
||||
@@ -333,9 +333,9 @@ def test_run_async_cta_query_with_lower_limit(test_client, ctas_method):
|
||||
query = wait_for_success(result)
|
||||
assert QueryStatus.SUCCESS == query.status
|
||||
|
||||
sqllite_select_sql = f"SELECT *\nFROM {tmp_table}\nLIMIT {query.limit}\nOFFSET 0"
|
||||
sqlite_select_sql = f"SELECT\n *\nFROM {tmp_table}\nLIMIT {query.limit}\nOFFSET 0"
|
||||
assert query.select_sql == (
|
||||
sqllite_select_sql
|
||||
sqlite_select_sql
|
||||
if backend() == "sqlite"
|
||||
else get_select_star(tmp_table, query.limit)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user