Skip to content
Open
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
@@ -0,0 +1,11 @@
{
"pages": [
{
"name": "main",
"displayName": "Main",
"pageType": "PAGE_TYPE_CANVAS",
"layoutVersion": "GRID_V1",
"layout": []
}
]
}
4 changes: 4 additions & 0 deletions acceptance/cmd/workspace/export-dir-dashboard/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions acceptance/cmd/workspace/export-dir-dashboard/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

>>> [CLI] workspace mkdirs /Workspace/Users/[USERNAME]/export-dir-dashboard-[UNIQUE_NAME]

>>> [CLI] workspace export-dir /Workspace/Users/[USERNAME]/export-dir-dashboard-[UNIQUE_NAME] [TEST_TMP_DIR]/export
Exporting files from /Workspace/Users/[USERNAME]/export-dir-dashboard-[UNIQUE_NAME]
/Workspace/Users/[USERNAME]/export-dir-dashboard-[UNIQUE_NAME]/export-dir-dashboard-[UNIQUE_NAME].lvdash.json -> [TEST_TMP_DIR]/export/export-dir-dashboard-[UNIQUE_NAME].lvdash.json
Export complete

>>> assert_exists.py [TEST_TMP_DIR]/export/export-dir-dashboard-[UNIQUE_NAME].lvdash.json
29 changes: 29 additions & 0 deletions acceptance/cmd/workspace/export-dir-dashboard/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
DASHBOARD_NAME="export-dir-dashboard-$UNIQUE_NAME"
DASHBOARD_DIR="/Workspace/Users/$CURRENT_USER_NAME/export-dir-dashboard-$UNIQUE_NAME"
dashboard_id=""

cleanup() {
if [ -n "$dashboard_id" ]; then
$CLI lakeview trash "$dashboard_id" >> LOG.cleanup 2>&1 || true
fi
$CLI workspace delete "$DASHBOARD_DIR" --recursive >> LOG.cleanup 2>&1 || true
}
trap cleanup EXIT

trace $CLI workspace mkdirs "$DASHBOARD_DIR"

dashboard_id=$($CLI lakeview create \
--display-name "$DASHBOARD_NAME" \
--warehouse-id "$TEST_DEFAULT_WAREHOUSE_ID" \
--serialized-dashboard "$(cat dashboard.lvdash.json)" \
--json "{\"parent_path\": \"$DASHBOARD_DIR\"}" \
-o json | jq -r '.dashboard_id')
add_repl "$dashboard_id" DASHBOARD_ID

mkdir -p "$TEST_TMP_DIR/export"
trace $CLI workspace export-dir "$DASHBOARD_DIR" "$TEST_TMP_DIR/export"

# The Lakeview backend normalizes the serialized dashboard on create (e.g. it
# drops an empty "layout": []), so the exported content is not byte-identical to
# the input. Assert the dashboard was exported rather than diffing the content.
trace assert_exists.py "$TEST_TMP_DIR/export/$DASHBOARD_NAME.lvdash.json"
12 changes: 12 additions & 0 deletions acceptance/cmd/workspace/export-dir-dashboard/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Cloud = true
RequiresWarehouse = true

# export-dir prints the local destination with OS-native separators, so the
# output diverges on Windows. The exported-dashboard behavior is OS-independent,
# so cover it on Linux/macOS only.
GOOS.windows = false

EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"]
Ignore = [
"export",
]
1 change: 0 additions & 1 deletion cmd/workspace/workspace/export_dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func isFileSizeError(err error) bool {
// These will be skipped with a warning during export-dir.
var nonExportableTypes = []workspace.ObjectType{
workspace.ObjectTypeLibrary,
workspace.ObjectTypeDashboard,
workspace.ObjectTypeRepo,
// MLFLOW_EXPERIMENT is not defined as a constant in the SDK
workspace.ObjectType("MLFLOW_EXPERIMENT"),
Expand Down
Loading