From 30c7d7a4418fe7724a474321242b49472b99adf7 Mon Sep 17 00:00:00 2001 From: vuong-nguyen <44292934+nkvuong@users.noreply.github.com> Date: Fri, 19 Apr 2024 18:11:43 +0100 Subject: [PATCH] Added more `NotFound` error type (#94) Some SQL queries will error with `Database(ucx_shydk,Some(hive_metastore)) does not exist`, `Function(hive_metastore.ucx_slgfw.ucx_tkrq6) does not exist`. We need to classify them as `NotFound` error messages --------- Co-authored-by: Serge Smertin <259697+nfx@users.noreply.github.com> --- src/databricks/labs/lsql/core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/databricks/labs/lsql/core.py b/src/databricks/labs/lsql/core.py index 0c008b90..541c411d 100644 --- a/src/databricks/labs/lsql/core.py +++ b/src/databricks/labs/lsql/core.py @@ -448,6 +448,8 @@ def _raise_if_needed(status: StatementStatus): raise NotFound(error_message) if "DELTA_TABLE_NOT_FOUND" in error_message: raise NotFound(error_message) + if "does not exist" in error_message: + raise NotFound(error_message) if "DELTA_MISSING_TRANSACTION_LOG" in error_message: raise DataLoss(error_message) mapping = {