mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
fix: handle comments in has_table_query (#23882)
This commit is contained in:
committed by
Elizabeth Thompson
parent
4af81bf70a
commit
60a1652be2
@@ -509,6 +509,9 @@ def has_table_query(token_list: TokenList) -> bool:
|
||||
"""
|
||||
state = InsertRLSState.SCANNING
|
||||
for token in token_list.tokens:
|
||||
# Ignore comments
|
||||
if isinstance(token, sqlparse.sql.Comment):
|
||||
continue
|
||||
|
||||
# Recurse into child token list
|
||||
if isinstance(token, TokenList) and has_table_query(token):
|
||||
@@ -607,7 +610,6 @@ def insert_rls(
|
||||
rls: Optional[TokenList] = None
|
||||
state = InsertRLSState.SCANNING
|
||||
for token in token_list.tokens:
|
||||
|
||||
# Recurse into child token list
|
||||
if isinstance(token, TokenList):
|
||||
i = token_list.tokens.index(token)
|
||||
|
||||
Reference in New Issue
Block a user