From 51d8b24409fdc19edaea754367593178116aefec Mon Sep 17 00:00:00 2001 From: v-chen_data Date: Wed, 25 Sep 2024 14:38:41 -0700 Subject: [PATCH] precommit --- llmfoundry/command_utils/data_prep/convert_delta_to_json.py | 6 ++++-- llmfoundry/utils/exceptions.py | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) 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 bfae8519e7..e4172c3aaa 100644 --- a/llmfoundry/command_utils/data_prep/convert_delta_to_json.py +++ b/llmfoundry/command_utils/data_prep/convert_delta_to_json.py @@ -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 diff --git a/llmfoundry/utils/exceptions.py b/llmfoundry/utils/exceptions.py index 99a46c7f71..265b9bbe8f 100644 --- a/llmfoundry/utils/exceptions.py +++ b/llmfoundry/utils/exceptions.py @@ -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, )