Skip to content

Commit

Permalink
move NotFound up
Browse files Browse the repository at this point in the history
  • Loading branch information
v-chen_data committed Jun 6, 2024
1 parent 37dbce3 commit d6621f9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions llmfoundry/utils/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,8 @@ def _verify_uc_path(path: str) -> bool:
from databricks.sdk import WorkspaceClient

w = WorkspaceClient()
w.files.get_metadata(path)
return True
except ImportError:
log.warning(
'Cannot verify the path of `UCVolumeDatasetSource` because of missing' + \
Expand All @@ -706,15 +708,11 @@ def _verify_uc_path(path: str) -> bool:
'`UCVolumeDatasetSource`, but your `UCVolumeDatasetSource` might be invalid.',
)
return False
except (NotFound, PermissionDenied):
return False
except Exception as e:
log.warning(
f'Cannot verify the path of `UCVolumeDatasetSource` due to an error. '
f'Error details: {str(e)}. This does not block creating `UCVolumeDatasetSource`, '
f'but your `UCVolumeDatasetSource` might be invalid.',
)

try:
w.files.get_metadata(path)
return True
except (NotFound, PermissionDenied):
return False

0 comments on commit d6621f9

Please sign in to comment.