Skip to content

Commit

Permalink
Remove Dashboard.as_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
JCZuurmond committed Nov 19, 2024
1 parent cac0b6e commit 9244a65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/databricks/labs/lsql/dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -1133,9 +1133,9 @@ def create_dashboard(
warehouse_id=warehouse_id,
)
if dashboard_id is not None:
sdk_dashboard = self._ws.lakeview.update(dashboard_id, dashboard=dashboard_to_create.as_dict()) # type: ignore
sdk_dashboard = self._ws.lakeview.update(dashboard_id, dashboard=dashboard_to_create)
else:
sdk_dashboard = self._ws.lakeview.create(dashboard=dashboard_to_create.as_dict()) # type: ignore
sdk_dashboard = self._ws.lakeview.create(dashboard=dashboard_to_create)
if publish:
assert sdk_dashboard.dashboard_id is not None
self._ws.lakeview.publish(sdk_dashboard.dashboard_id, warehouse_id=warehouse_id)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def create(*, display_name: str = "") -> SDKDashboard:
display_name = f"created_by_lsql_{make_random()}"
else:
display_name = f"{display_name} ({make_random()})"
dashboard = ws.lakeview.create(dashboard=SDKDashboard(display_name=display_name).as_dict())
dashboard = ws.lakeview.create(dashboard=SDKDashboard(display_name=display_name))
if is_in_debug():
dashboard_url = f"{ws.config.host}/sql/dashboardsv3/{dashboard.dashboard_id}"
webbrowser.open(dashboard_url)
Expand Down

0 comments on commit 9244a65

Please sign in to comment.