Skip to content

Commit dede64d

Browse files
authored
Catch all errors when checking Databricks path, notably BadRequest ones (#156)
Progresses #databrickslabs/ucx#2882 Co-authored-by: Eric Vergnaud <[email protected]>
1 parent 8d15554 commit dede64d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/databricks/labs/blueprint/paths.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from urllib.parse import quote_from_bytes as urlquote_from_bytes
2121

2222
from databricks.sdk import WorkspaceClient
23-
from databricks.sdk.errors import DatabricksError, NotFound, ResourceDoesNotExist
23+
from databricks.sdk.errors import DatabricksError, ResourceDoesNotExist
2424
from databricks.sdk.service.files import FileInfo
2525
from databricks.sdk.service.workspace import (
2626
ExportFormat,
@@ -609,7 +609,7 @@ def exists(self, *, follow_symlinks: bool = True) -> bool:
609609
try:
610610
self._cached_file_info = self._ws.dbfs.get_status(self.as_posix())
611611
return True
612-
except NotFound:
612+
except DatabricksError:
613613
return False
614614

615615
def _mkdir(self) -> None:
@@ -754,7 +754,7 @@ def exists(self, *, follow_symlinks: bool = True) -> bool:
754754
try:
755755
self._cached_object_info = self._ws.workspace.get_status(self.as_posix())
756756
return True
757-
except NotFound:
757+
except DatabricksError:
758758
return False
759759

760760
def _mkdir(self) -> None:

0 commit comments

Comments
 (0)