Skip to content

Commit d38785a

Browse files
committed
Improve logging and add return type to validate location
1 parent 1171ca7 commit d38785a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/databricks/labs/ucx/hive_metastore/catalog_schema.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,19 +199,20 @@ def _get_missing_catalogs_schemas(self) -> tuple[set[str], dict[str, set[str]]]:
199199
target_schemas[catalog] = target_schemas[catalog] - schemas
200200
return target_catalogs, target_schemas
201201

202-
def _validate_location(self, location: str):
202+
def _validate_location(self, location: str) -> bool:
203203
if location == "metastore":
204204
return True
205205
try:
206206
PurePath(location)
207207
except ValueError:
208-
logger.error(f"Invalid location path {location}")
208+
logger.error(f"Invalid location path: {location}")
209209
return False
210210
for external_location in self._external_locations:
211211
if location == external_location.url:
212212
return True
213213
if external_location.url is not None and fnmatch.fnmatch(location, external_location.url + '*'):
214214
return True
215+
logger.warning(f"No matching external location found for: {location}")
215216
return False
216217

217218
def _create_catalog(self, catalog: str, catalog_storage: str, *, properties: dict[str, str] | None) -> None:

0 commit comments

Comments
 (0)