Skip to content

Commit

Permalink
Added more NotFound error type (#94)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nkvuong and nfx authored Apr 19, 2024
1 parent 5782b23 commit 30c7d7a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/databricks/labs/lsql/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 30c7d7a

Please sign in to comment.