From 3e3bc5f165f93d35777847287fa4033f08b1575a Mon Sep 17 00:00:00 2001 From: Brian <23239305+b-chu@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:43:58 -0500 Subject: [PATCH] Add permission error (#1703) --- .../command_utils/data_prep/convert_delta_to_json.py | 8 ++++++++ tests/a_scripts/data_prep/test_convert_delta_to_json.py | 9 +++++++++ 2 files changed, 17 insertions(+) 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 1a0e575850..36d7adb717 100644 --- a/llmfoundry/command_utils/data_prep/convert_delta_to_json.py +++ b/llmfoundry/command_utils/data_prep/convert_delta_to_json.py @@ -730,6 +730,14 @@ def fetch_DT( message= f'The data preparation cluster you provided is not usable. Please retry with a cluster that is healthy and alive. {e}', ) from e + if isinstance( + e, + spark_errors.SparkConnectGrpcException, + ) and 'do not have permission to attach to cluster' in str(e): + raise FaultyDataPrepCluster( + message= + f'You do not have permission to attach to the data preparation cluster you provided. {e}', + ) from e if isinstance(e, grpc.RpcError) and e.code( ) == grpc.StatusCode.INTERNAL and 'Job aborted due to stage failure' in e.details( ): diff --git a/tests/a_scripts/data_prep/test_convert_delta_to_json.py b/tests/a_scripts/data_prep/test_convert_delta_to_json.py index 95610f00b6..4733fc2a18 100644 --- a/tests/a_scripts/data_prep/test_convert_delta_to_json.py +++ b/tests/a_scripts/data_prep/test_convert_delta_to_json.py @@ -625,6 +625,15 @@ def test_fetch_DT_catches_grpc_errors( 'The data preparation cluster you provided is not usable. Please retry with a cluster that is healthy and alive.', ], ), + ( + SparkConnectGrpcException( + 'do not have permission to attach to cluster etc...', + ), + FaultyDataPrepCluster, + [ + 'You do not have permission to attach to the data preparation cluster you provided.', + ], + ), ( grpc_lib_error, FaultyDataPrepCluster,