This is an automated email from the ASF dual-hosted git repository.
beto pushed a commit to branch fix_union_is_select
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/fix_union_is_select by this
push:
new 6830fd73d2 Make code cooler
6830fd73d2 is described below
commit 6830fd73d247264b74943a6607ce9f3a47fb3d5e
Author: Beto Dealmeida <[email protected]>
AuthorDate: Wed Sep 13 16:21:10 2023 -0700
Make code cooler
---
superset/sql_parse.py | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/superset/sql_parse.py b/superset/sql_parse.py
index 3d853f16bf..d75551bef0 100644
--- a/superset/sql_parse.py
+++ b/superset/sql_parse.py
@@ -231,11 +231,8 @@ class ParsedQuery:
"""
def is_body_select(body: dict[str, Any]) -> bool:
- if "SetOperation" in body:
- return is_body_select(body["SetOperation"]["left"]) and
is_body_select(
- body["SetOperation"]["right"]
- )
-
+ if op := body.get("SetOperation"):
+ return is_body_select(op["left"]) and
is_body_select(op["right"])
return all(key == "Select" for key in body.keys())
for query in oxide_parse: