Skip to content

Commit

Permalink
Add permission error (#1703)
Browse files Browse the repository at this point in the history
  • Loading branch information
b-chu authored Jan 7, 2025
1 parent 0959e9c commit 3e3bc5f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 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 @@ -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(
):
Expand Down
9 changes: 9 additions & 0 deletions tests/a_scripts/data_prep/test_convert_delta_to_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3e3bc5f

Please sign in to comment.