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 30, 2024
1 parent 133045b commit 0ade30d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ def fetch_DT(
) == grpc.StatusCode.INTERNAL and 'Job aborted due to stage failure' in e.details(
):
raise InternalError(
message=f'Possible Hardware Failure: {e.details()}'
message=f'Possible Hardware Failure: {e.details()}',
) from e
raise e

Expand Down
9 changes: 6 additions & 3 deletions tests/a_scripts/data_prep/test_convert_delta_to_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,12 @@ def test_format_tablename(self):

@patch('llmfoundry.command_utils.data_prep.convert_delta_to_json.fetch')
@patch(
'llmfoundry.command_utils.data_prep.convert_delta_to_json.validate_and_get_cluster_info'
'llmfoundry.command_utils.data_prep.convert_delta_to_json.validate_and_get_cluster_info',
)
def test_fetch_DT_grpc_error_handling(
self, mock_validate_cluster_info: MagicMock, mock_fetch: MagicMock
self,
mock_validate_cluster_info: MagicMock,
mock_fetch: MagicMock,
):
# Arrange
# Mock the validate_and_get_cluster_info to return test values
Expand Down Expand Up @@ -571,7 +573,8 @@ def test_fetch_DT_grpc_error_handling(
# Verify that the InternalError contains the expected message
self.assertIn('Possible Hardware Failure', str(context.exception))
self.assertIn(
'Job aborted due to stage failure', str(context.exception)
'Job aborted due to stage failure',
str(context.exception),
)

# Verify that fetch was called
Expand Down

0 comments on commit 0ade30d

Please sign in to comment.