Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def load(self, source_system: str) -> dict:
if self.templates_dir is None:
raise ValueError("Dashboard template path cannot be empty.")

filename = f"{source_system.lower()}_dashboard.lvdash.json"
filename = f"lakebridge_{source_system.lower()}_profiler_summary.lvdash.json"
filepath = os.path.join(self.templates_dir, filename)
if not os.path.exists(filepath):
raise FileNotFoundError(f"Could not find dashboard template matching {source_system}.")
Expand Down Expand Up @@ -63,8 +63,8 @@ def _replace_catalog_schema(
serialized_dashboard: str,
new_catalog: str,
new_schema: str,
old_catalog: str = "`PROFILER_CATALOG`",
old_schema: str = "`PROFILER_SCHEMA`",
old_catalog: str = "<CATALOG_NAME>",
old_schema: str = "<SCHEMA_NAME>",
):
"""Given a serialized JSON dashboard, replaces all catalog and schema references with the
provided catalog and schema names."""
Expand All @@ -80,7 +80,7 @@ def _create_or_replace_dashboard(
"""

# Load the dashboard template
logging.info(f"Loading dashboard template from folder: {folder}")
logger.info(f"Loading dashboard template from folder: {folder}")
dash_reference = f"{folder.stem}".lower()
dashboard_loader = DashboardTemplateLoader(folder)
dashboard_json = dashboard_loader.load(source_system="synapse")
Expand All @@ -101,15 +101,15 @@ def _create_or_replace_dashboard(
try:
dashboard = self._ws.lakeview.create(dashboard=dashboard)
except ResourceAlreadyExists:
logging.info("Dashboard already exists! Removing dashboard from workspace location.")
logger.info("Dashboard already exists! Removing dashboard from workspace location.")
dashboard_ws_path = str(Path(ws_parent_path) / f"{self._DASHBOARD_NAME}.lvdash.json")
self._ws.workspace.delete(dashboard_ws_path)
dashboard = self._ws.lakeview.create(dashboard=dashboard)
except DatabricksError as e:
logging.error(f"Could not create profiler summary dashboard: {e}")
logger.error(f"Could not create profiler summary dashboard: {e}")

assert dashboard.dashboard_id is not None
logging.info(f"Created dashboard '{dashboard.dashboard_id}' in workspace location {ws_parent_path}.")
logger.info(f"Created dashboard '{dashboard.dashboard_id}' in workspace location {ws_parent_path}.")
self._install_state.dashboards[dash_reference] = dashboard.dashboard_id
return dashboard

Expand Down
Loading
Loading