Skip to content

Commit f751f20

Browse files
authored
Update dashboard install using latest lsql release (#2246)
## Changes <!-- Summary of your changes that are easy to understand. Add screenshots when necessary --> ### Linked issues Dashboard issues arose after formatting the quries ### Functionality - [x] modified existing command: `databricks labs instal ucx` ### Tests - [x] manually tested - [x] verified on staging environment (screenshot attached)
1 parent cf9d1cf commit f751f20

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

src/databricks/labs/ucx/install.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -562,14 +562,22 @@ def _create_dashboard(self, folder: Path, *, parent_path: str | None = None) ->
562562
)
563563
metadata.display_name = f"{self._name('UCX ')} {folder.parent.stem.title()} ({folder.stem.title()})"
564564
reference = f"{folder.parent.stem}_{folder.stem}".lower()
565-
dashboard = Dashboards(self._ws).deploy_dashboard(
566-
metadata.as_lakeview(),
567-
dashboard_id=self._install_state.dashboards.get(reference),
565+
dashboard_id = self._install_state.dashboards.get(reference)
566+
if dashboard_id is not None and "-" in dashboard_id: # Upgrading from Redash to Lakeview
567+
logger.info(f"Upgrading dashboard to Lakeview: {metadata.display_name}")
568+
try:
569+
self._ws.dashboards.delete(dashboard_id=dashboard_id)
570+
except RuntimeError as e:
571+
logger.info(f"Cannot delete dashboard: {e}")
572+
dashboard_id = None
573+
dashboard = Dashboards(self._ws).create_dashboard(
574+
metadata,
575+
dashboard_id=dashboard_id,
568576
parent_path=parent_path,
569577
warehouse_id=self._warehouse_id,
578+
publish=True,
570579
)
571580
assert dashboard.dashboard_id is not None
572-
self._ws.lakeview.publish(dashboard.dashboard_id)
573581
self._install_state.dashboards[reference] = dashboard.dashboard_id
574582

575583
def uninstall(self):

src/databricks/labs/ucx/queries/assessment/main/01_0_compatibility.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* --title 'UC readiness' --width 2 --height 4 */
1+
/* --title 'UC readiness' --height 4 */
22
WITH raw AS (
33
SELECT
44
object_type,

src/databricks/labs/ucx/queries/assessment/main/01_1_count_jobs.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* --title 'Total Jobs' --width 2 --height 4 */
1+
/* --title 'Total Jobs' --height 4 */
22
SELECT
33
COUNT(*) AS count_total_jobs
44
FROM inventory.jobs

src/databricks/labs/ucx/queries/assessment/main/01_3_count_table_by_type_location_format.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* --title 'Table counts by type, location and format' --width 4 --height 4 */
1+
/* --title 'Table counts by type, location and format' --width 2 --height 4 */
22
SELECT
33
object_type AS source_table_type,
44
table_format AS format,

0 commit comments

Comments
 (0)