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 7b3ab7a5e8..81d4cd2715 100644 --- a/llmfoundry/command_utils/data_prep/convert_delta_to_json.py +++ b/llmfoundry/command_utils/data_prep/convert_delta_to_json.py @@ -493,13 +493,7 @@ def fetch( if isinstance(e, (AnalysisException, ServerOperationError)): if 'INSUFFICIENT_PERMISSIONS' in str(e): - match = re.search(r"(?:Table|Schema)\s+'([^']+)'", str(e)) - if match: - object_name = match.group(1) - action = f'accessing {object_name}' - else: - action = f'accessing {tablename}' - raise InsufficientPermissionsError(action=action) from e + raise InsufficientPermissionsError(str(e)) from e if isinstance(e, InsufficientPermissionsError): raise diff --git a/llmfoundry/utils/exceptions.py b/llmfoundry/utils/exceptions.py index 265b9bbe8f..5904062285 100644 --- a/llmfoundry/utils/exceptions.py +++ b/llmfoundry/utils/exceptions.py @@ -456,6 +456,5 @@ def __init__( class InsufficientPermissionsError(UserError): """Error thrown when the user does not have sufficient permissions.""" - def __init__(self, action: str) -> None: - message = f'Insufficient permissions when {action}. Please check your permissions.' - super().__init__(message, action=action) + def __init__(self, message: str) -> None: + super().__init__(message)