Skip to content

Commit

Permalink
Add permission error
Browse files Browse the repository at this point in the history
  • Loading branch information
b-chu committed Jan 6, 2025
1 parent 3269c73 commit 6ec14c5
Show file tree
Hide file tree
Showing 2 changed files with 15 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
7 changes: 7 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,13 @@ 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 6ec14c5

Please sign in to comment.