Skip to content

Commit 728ca50

Browse files
authored
Fix some nits missed from the PR comments (#4210)
Quick PR to fix some nits that were missed from PR from #4209
1 parent 9157b72 commit 728ca50

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/databricks/labs/ucx/install.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,6 @@ def _handle_existing_dashboard(self, dashboard_id: str, display_name: str, paren
634634
return dashboard_id # Update the existing dashboard
635635

636636
def _is_redash_dashboard(self, dashboard_id: str) -> bool:
637-
"""Check if the dashboard is a Redash dashboard"""
638637
return "-" in dashboard_id
639638

640639
def _upgrade_redash_dashboard(self, dashboard_id: str, display_name: str) -> None:
@@ -646,9 +645,10 @@ def _upgrade_redash_dashboard(self, dashboard_id: str, display_name: str) -> Non
646645

647646
def _is_trashed_dashboard(self, dashboard, display_name: str, dashboard_id: str) -> bool:
648647
if dashboard.lifecycle_state is None:
649-
raise NotFound(f"Dashboard life cycle state: {display_name} ({dashboard_id})")
648+
msg = f"Dashboard life cycle state: {display_name} ({dashboard_id})"
649+
raise NotFound(msg)
650650
if dashboard.lifecycle_state == LifecycleState.TRASHED:
651-
logger.info(f"Recreating trashed dashboard: {display_name} ({dashboard_id})")
651+
logger.info(f"Dashboard life cycle in trashed state: {display_name} ({dashboard_id})")
652652
return True
653653
return False
654654

tests/unit/install/test_install_dashboards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def test_installation_recreates_trashed_lakeview_dashboard(caplog, ws, workspace
119119
ws.lakeview.get.return_value = LakeviewDashboard(lifecycle_state=LifecycleState.TRASHED)
120120
with caplog.at_level(logging.INFO, logger="databricks.labs.ucx.install"):
121121
workspace_installation.run()
122-
assert "Recreating trashed dashboard" in caplog.text
122+
assert "Dashboard life cycle in trashed state" in caplog.text
123123
ws.lakeview.create.assert_called()
124124
ws.lakeview.update.assert_not_called()
125125

0 commit comments

Comments
 (0)