mirror of
https://github.com/apache/superset.git
synced 2026-04-28 04:25:07 +00:00
fix: allow subquery in ad-hoc SQL (WIP) (#19242)
* allow adhoc subquery * add config for allow ad hoc subquery * default to true allow adhoc subquery * fix test * Update superset/errors.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * Update superset/connectors/sqla/utils.py Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com> * rename and add doc string * fix for big query test * Update superset/connectors/sqla/utils.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * Apply suggestions from code review Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * add test * update validate adhoc subquery Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com>
This commit is contained in:
@@ -1208,6 +1208,8 @@ def test_sqlparse_issue_652():
|
||||
("SELECT * FROM (SELECT 1 AS foo, 2 AS bar) ORDER BY foo ASC, bar", False),
|
||||
("SELECT * FROM other_table", True),
|
||||
("extract(HOUR from from_unixtime(hour_ts)", False),
|
||||
("(SELECT * FROM table)", True),
|
||||
("(SELECT COUNT(DISTINCT name) from birth_names)", True),
|
||||
],
|
||||
)
|
||||
def test_has_table_query(sql: str, expected: bool) -> None:
|
||||
|
||||
Reference in New Issue
Block a user