Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UC not enabled error for delta to json conversion #1613

Merged
merged 3 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading