Skip to content

Commit

Permalink
Catch all errors when checking Databricks path, notably BadRequest on…
Browse files Browse the repository at this point in the history
…es (#156)

Progresses #databrickslabs/ucx#2882

Co-authored-by: Eric Vergnaud <[email protected]>
  • Loading branch information
ericvergnaud and ericvergnaud authored Oct 10, 2024
1 parent 8d15554 commit dede64d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/databricks/labs/blueprint/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from urllib.parse import quote_from_bytes as urlquote_from_bytes

from databricks.sdk import WorkspaceClient
from databricks.sdk.errors import DatabricksError, NotFound, ResourceDoesNotExist
from databricks.sdk.errors import DatabricksError, ResourceDoesNotExist
from databricks.sdk.service.files import FileInfo
from databricks.sdk.service.workspace import (
ExportFormat,
Expand Down Expand Up @@ -609,7 +609,7 @@ def exists(self, *, follow_symlinks: bool = True) -> bool:
try:
self._cached_file_info = self._ws.dbfs.get_status(self.as_posix())
return True
except NotFound:
except DatabricksError:
return False

def _mkdir(self) -> None:
Expand Down Expand Up @@ -754,7 +754,7 @@ def exists(self, *, follow_symlinks: bool = True) -> bool:
try:
self._cached_object_info = self._ws.workspace.get_status(self.as_posix())
return True
except NotFound:
except DatabricksError:
return False

def _mkdir(self) -> None:
Expand Down

0 comments on commit dede64d

Please sign in to comment.