-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix dashboard deployment/creation #230
Conversation
This PR breaks backwards compatibility for databrickslabs/ucx downstream. See build logs for more details. Running from downstreams #320 |
|
||
def deploy_dashboard(self, dashboard: Dashboard, **kwargs) -> SDKDashboard: | ||
"""Legacy method use :meth:create_dashboard instead.""" | ||
warnings.warn("Deprecated method use `create_dashboard` instead.", category=DeprecationWarning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To use the DashboardMetadata.validate
on the before dashboard creation, the signature is updated to expect DashboardMetadata
instead of Dashboard
. For backwards capability, the deploy_dashboard
signature is unchanged, but intended to be deprecated. The implementation below creates the DashboardMetadata
from the Dashboard
through saving the dashboard to a temporary folder.
@nfx: Do you want to add a date to the deprecation warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one transition version is fine
✅ 35/35 passed, 2 skipped, 8m45s total Running from acceptance #324 |
|
||
assert ws.lakeview.get(sdk_dashboard.dashboard_id) | ||
|
||
|
||
def test_dashboards_deploys_dashboard_with_invalid_query(ws, make_dashboard, tmp_path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed as we want the dashboard creation with an invalid query to fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
||
def deploy_dashboard(self, dashboard: Dashboard, **kwargs) -> SDKDashboard: | ||
"""Legacy method use :meth:create_dashboard instead.""" | ||
warnings.warn("Deprecated method use `create_dashboard` instead.", category=DeprecationWarning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one transition version is fine
* Fixed dashboard deployment/creation ([#230](#230)). The recent changes to our open-source library address issues related to dashboard deployment and creation, enhancing their reliability and consistency. The `deploy_dashboard` function has been deprecated in favor of the more accurate `create_dashboard` function, which now includes a `publish` flag. A `validate` method has been added to the `Tile`, `MarkdownTile`, and `QueryTile` classes to raise an error if the dashboard is invalid. The `test_dashboards.py` file has been updated to reflect these changes. These enhancements address issues [#222](#222), [#229](#229), and partially resolve [#220](#220). The commit includes an image of a dashboard created through the deprecated `deploy_dashboard` method. These improvements ensure better dashboard creation, validation, and deployment, while also maintaining backward compatibility through the deprecation of `deploy_dashboard`.
* Fixed dashboard deployment/creation ([#230](#230)). The recent changes to our open-source library address issues related to dashboard deployment and creation, enhancing their reliability and consistency. The `deploy_dashboard` function has been deprecated in favor of the more accurate `create_dashboard` function, which now includes a `publish` flag. A `validate` method has been added to the `Tile`, `MarkdownTile`, and `QueryTile` classes to raise an error if the dashboard is invalid. The `test_dashboards.py` file has been updated to reflect these changes. These enhancements address issues [#222](#222), [#229](#229), and partially resolve [#220](#220). The commit includes an image of a dashboard created through the deprecated `deploy_dashboard` method. These improvements ensure better dashboard creation, validation, and deployment, while also maintaining backward compatibility through the deprecation of `deploy_dashboard`.
Fixes the dashboard deployment by:
deploy_dashboard
for thecreate_dashboard
as this is more accurate and available after refactoring Lakeview dashboard creation to be part ofDashboardMetadata
publish
flag tocreate_dashboard
Related issues
save_to_folder
does not persist markdown tiles #229Below the dashboard created through the deprecated
deploy_dashboard
: