Skip to content

Commit

Permalink
Add UC not enabled error for delta to json conversion (#1613)
Browse files Browse the repository at this point in the history
  • Loading branch information
irenedea authored Oct 24, 2024
1 parent 08702d2 commit c001963
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions llmfoundry/command_utils/data_prep/convert_delta_to_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
FailedToCreateSQLConnectionError,
FaultyDataPrepCluster,
InsufficientPermissionsError,
UCNotEnabledError,
)

if TYPE_CHECKING:
Expand Down Expand Up @@ -500,6 +501,8 @@ def fetch(
if isinstance(e, (AnalysisException, ServerOperationError)):
if 'INSUFFICIENT_PERMISSIONS' in str(e):
raise InsufficientPermissionsError(str(e)) from e
elif 'UC_NOT_ENABLED' in str(e):
raise UCNotEnabledError() from e

if isinstance(e, InsufficientPermissionsError):
raise
Expand Down
8 changes: 8 additions & 0 deletions llmfoundry/utils/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,3 +524,11 @@ def __reduce__(self):

def __str__(self):
return self.message


class UCNotEnabledError(UserError):
"""Error thrown when user does not have UC enabled on their cluster."""

def __init__(self) -> None:
message = f'Unity Catalog is not enabled on your cluster.'
super().__init__(message)

0 comments on commit c001963

Please sign in to comment.