Skip to content

Commit 29660e8

Browse files
committed
Simplify external location match
1 parent d38785a commit 29660e8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import collections
22
import logging
33
from dataclasses import replace
4-
import fnmatch
54
from pathlib import PurePath
65

76
from databricks.labs.blueprint.tui import Prompts
@@ -208,9 +207,7 @@ def _validate_location(self, location: str) -> bool:
208207
logger.error(f"Invalid location path: {location}")
209208
return False
210209
for external_location in self._external_locations:
211-
if location == external_location.url:
212-
return True
213-
if external_location.url is not None and fnmatch.fnmatch(location, external_location.url + '*'):
210+
if external_location.url is not None and location.startswith(external_location.url):
214211
return True
215212
logger.warning(f"No matching external location found for: {location}")
216213
return False

0 commit comments

Comments
 (0)