Skip to content

Commit 4a75a7b

Browse files
authored
raise warning instead of error to allow assessment in regions that do not support certain features (#2128)
## Changes raise warning instead of error to allow assessment in regions that do not support certain features ### Linked issues Resolves #2082 ### Functionality None ### Tests - [x] added unit tests Co-authored-by: Eric Vergnaud <[email protected]>
1 parent f987244 commit 4a75a7b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/databricks/labs/ucx/workspace_access/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __iter__(self):
5959
for item in self._func():
6060
yield GenericPermissionsInfo(getattr(item, self._id_attribute), self._object_type)
6161
except NotFound as e:
62-
logger.error(f"Listing {self._object_type} failed: {e}")
62+
logger.warning(f"Listing {self._object_type} failed: {e}")
6363
since = datetime.datetime.now() - started
6464
logger.info(f"Listed {self._object_type} in {since}")
6565

tests/unit/workspace_access/test_generic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,11 +918,11 @@ def test_models_page_listing():
918918
assert item.object_type == "registered-models"
919919

920920

921-
def test_serving_endpoints_not_enabled(caplog):
921+
def test_serving_endpoints_not_enabled_raises_warning(caplog):
922922
ws = create_autospec(WorkspaceClient)
923923
ws.serving_endpoints.list.side_effect = NotFound("Model serving is not enabled for your shard")
924924

925925
sup = GenericPermissionsSupport(ws=ws, listings=[Listing(ws.serving_endpoints.list, "id", "serving-endpoints")])
926-
with caplog.at_level('ERROR'):
926+
with caplog.at_level('WARNING'):
927927
list(sup.get_crawler_tasks())
928928
assert "Listing serving-endpoints failed: Model serving is not enabled for your shard" in caplog.text

0 commit comments

Comments
 (0)