mirror of
https://github.com/apache/superset.git
synced 2024-09-12 16:49:40 -04:00
chore(sql_parse): Strip leading/trailing whitespace in Jinja macro extraction (#27842)
(cherry picked from commit 5ab95aaf7d
)
This commit is contained in:
parent
54942e2eaa
commit
a39971abcd
@ -1093,7 +1093,7 @@ def extract_tables_from_jinja_sql(sql: str, database: Database) -> set[Table]:
|
||||
tables.add(
|
||||
Table(
|
||||
*[
|
||||
remove_quotes(part)
|
||||
remove_quotes(part.strip())
|
||||
for part in node.args[0].value.split(".")[::-1]
|
||||
if len(node.args) == 1
|
||||
]
|
||||
|
@ -1890,6 +1890,7 @@ SELECT * FROM t"""
|
||||
"macro",
|
||||
[
|
||||
"latest_partition('foo.bar')",
|
||||
"latest_partition(' foo.bar ')", # Non-atypical user error which works
|
||||
"latest_sub_partition('foo.bar', baz='qux')",
|
||||
],
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user