Skip to content

Commit

Permalink
precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
v-chen_data committed Sep 25, 2024
1 parent 4ab5bc1 commit 51d8b24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions llmfoundry/command_utils/data_prep/convert_delta_to_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,12 +547,14 @@ def validate_and_get_cluster_info(
if res is None:
raise ClusterDoesNotExistError(cluster_id)

data_security_mode = str(res.data_security_mode).upper()[len('DATASECURITYMODE.'):]
data_security_mode = str(res.data_security_mode
).upper()[len('DATASECURITYMODE.'):]

# USER_ISOLATION stands for Shared Access Mode
if data_security_mode not in ('USER_ISOLATION', 'SINGLE_USER'):
raise ClusterInvalidAccessMode(
cluster_id=cluster_id, access_mode=data_security_mode
cluster_id=cluster_id,
access_mode=data_security_mode,
)

assert res.spark_version is not None
Expand Down
4 changes: 3 additions & 1 deletion llmfoundry/utils/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,9 @@ def __init__(self, cluster_id: str, access_mode: str) -> None:
message = f'Cluster with id {cluster_id} has access mode {access_mode}. ' + \
'please make sure the cluster used has access mode Shared or Single User!'
super().__init__(
message, cluster_id=cluster_id, access_mode=access_mode
message,
cluster_id=cluster_id,
access_mode=access_mode,
)


Expand Down

0 comments on commit 51d8b24

Please sign in to comment.