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
46 changes: 46 additions & 0 deletions knowledge_base/dashboard_nyc_taxi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Dashboard for NYC Taxi Trip Analysis

This example demonstrates how to define an AI/BI dashboard in a Databricks Asset Bundle.

It includes and deploys the sample __NYC Taxi Trip Analysis__ dashboard to a Databricks workspace.

For more information about AI/BI dashboards, please refer to the [documentation](https://docs.databricks.com/dashboards/index.html).

## Prerequisites

* Databricks CLI v0.232.0 or above

## Usage

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the steps in here be numbered?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could but then should apply it in the other examples in the knowledge base as well.

What do you typically convey with numbering over plain enumeration?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can fix this in a separate PR if needed.


Modify `databricks.yml`:
* Update the `host` field under `workspace` to the Databricks workspace to deploy to.
* Update the `warehouse` field under `warehouse_id` to the name of the SQL warehouse to use.

Run `databricks bundle deploy` to deploy the dashboard.

Run `databricks bundle open` to navigate to the deployed dashboard in your browser. Alternatively, run `databricks bundle summary` to display its URL.

### Visual modification

You can use the Databricks UI to modify the dashboard, but any modifications made through the UI will not be applied to the bundle `.lvdash.json` file unless you explicitly update it.

To update the local bundle `.lvdash.json` file, run:

```sh
databricks bundle generate dashboard --resource nyc_taxi_trip_analysis --force
```

To continuously poll and retrieve the updated `.lvdash.json` file when it changes, run:

```sh
databricks bundle generate dashboard --resource nyc_taxi_trip_analysis --force --watch
```

Any remote modifications of a dashboard are noticed by the `deploy` command and require
you to acknowledge that remote changes can be overwritten by local changes.
It is therefore recommended to run the `generate` command before running the `deploy` command.
Otherwise, you may lose your remote changes.

### Manual modification

You can modify the `.lvdash.json` file directly and redeploy to observe your changes.
20 changes: 20 additions & 0 deletions knowledge_base/dashboard_nyc_taxi/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
bundle:
name: dashboard_nyc_taxi

include:
- resources/*.yml

variables:
# The "warehouse_id" variable is used to reference the warehouse used by the dashboard.
warehouse_id:
lookup:
# Replace this with the name of your SQL warehouse.
warehouse: "Shared Unity Catalog Severless"

workspace:
host: https://myworkspace.databricks.com

targets:
dev:
default: true
mode: development
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
resources:
dashboards:
nyc_taxi_trip_analysis:
display_name: "NYC Taxi Trip Analysis"
file_path: ../src/nyc_taxi_trip_analysis.lvdash.json
warehouse_id: ${var.warehouse_id}

# If "embed_credentials" is set to true, the bundle deployment identity's credentials
# are used to execute queries for all dashboard viewers.
# If it is set to false, each viewer's own credentials will be used instead.
#
# It defaults to false.
#
# embed_credentials: false

# The "parent_path" field can be configured to place the dashboard in a
# non-standard folder in the workspace.
#
# It defaults to "${workspace.resource_path}", which is located
# under the bundle deployment root.
#
# parent_path: ${workspace.resource_path}
Loading