Skip to content

Commit 18b12bf

Browse files
committed
fix another missing piece
1 parent efc0558 commit 18b12bf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

dbt/adapters/databricks/connections.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@
8787
)
8888

8989

90+
mv_refresh_regex = re.compile(r"refresh\s+materialized\s+view\s+([`\w.]+)", re.IGNORECASE)
91+
st_refresh_regex = re.compile(
92+
r"create\s+or\s+refresh\s+streaming\s+table\s+([`\w.]+)", re.IGNORECASE
93+
)
9094
logger = AdapterLogger("Databricks")
9195

9296

@@ -1561,9 +1565,9 @@ def _should_poll_refresh(sql: str) -> Tuple[bool, str]:
15611565
# if the command was to refresh a materialized view we need to poll
15621566
# the pipeline until the refresh is finished.
15631567
name = ""
1564-
refresh_search = re.search(r"refresh\s+materialized\s+view\s+([`\w.]+)", sql)
1568+
refresh_search = mv_refresh_regex.search(sql)
15651569
if not refresh_search:
1566-
refresh_search = re.search(r"create\s+or\s+refresh\s+streaming\s+table\s+([`\w.]+)", sql)
1570+
refresh_search = st_refresh_regex.search(sql)
15671571

15681572
if refresh_search:
15691573
name = refresh_search.group(1).replace("`", "")

0 commit comments

Comments
 (0)