diff --git a/llmfoundry/command_utils/data_prep/convert_delta_to_json.py b/llmfoundry/command_utils/data_prep/convert_delta_to_json.py index fb1ee1d0ca..2eaaa32538 100644 --- a/llmfoundry/command_utils/data_prep/convert_delta_to_json.py +++ b/llmfoundry/command_utils/data_prep/convert_delta_to_json.py @@ -25,6 +25,7 @@ FailedToCreateSQLConnectionError, FaultyDataPrepCluster, InsufficientPermissionsError, + UCNotEnabledError, ) if TYPE_CHECKING: @@ -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 diff --git a/llmfoundry/utils/exceptions.py b/llmfoundry/utils/exceptions.py index 905a376ef3..f1f987e2ad 100644 --- a/llmfoundry/utils/exceptions.py +++ b/llmfoundry/utils/exceptions.py @@ -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)