Skip to content

Commit

Permalink
Let dashboard name adhere to naming convention
Browse files Browse the repository at this point in the history
Resource names should only contain alphanumeric characters (a-z, A-Z, 0-9), hyphens (-), or underscores (_)
  • Loading branch information
JCZuurmond committed Feb 27, 2025
1 parent 864fdff commit 048bc8f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/databricks/labs/ucx/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,15 @@ def _create_dashboard(self, folder: Path, *, parent_path: str) -> None:
)
)
metadata.display_name = f"{self._name('UCX ')} {folder.parent.stem.title()} ({folder.stem.title()})"
# TODO: Remove temporary fix for the dashboard name:
# resource names should only contain alphanumeric characters (a-z, A-Z, 0-9), hyphens (-), or underscores (_)
metadata.display_name = (
metadata.display_name.replace(" ", "_")
.replace("[", "-")
.replace("]", "-")
.replace("(", "")
.replace(")", "")
)
reference = f"{folder.parent.stem}_{folder.stem}".lower()
dashboard_id = self._install_state.dashboards.get(reference)
if dashboard_id is not None:
Expand Down

0 comments on commit 048bc8f

Please sign in to comment.