Skip to content

Commit c96bcae

Browse files
tgberkeleyElijahAhianyomasenfcarlosabadiadevin-ai-integration[bot]
authored
Databricks integration (#1669)
* Remove print statement (#241) * Do not require redis in rxconfig.py (#395) * use rx.color instead of var in icon docs page (#1019) * Revert the last two deploy workflow commits (#1308) * Revert "Fix: Remove interactive flag from deploy workflows (#1307)" This reverts commit 08d1ce0bc34058c489ac580ffde194cfcc45b4ac. * Revert "Fix: Replace --no-interactive with --interactive=false in deploy workflows (#1306)" This reverts commit 55aed9660525cdd3b477a26141ab176640590a7b. --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * databricks docs --------- Co-authored-by: Elijah Ahianyo <[email protected]> Co-authored-by: Masen Furer <[email protected]> Co-authored-by: Carlos <[email protected]> Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Tom Gotsman <[email protected]>
1 parent 3dea562 commit c96bcae

File tree

5 files changed

+94
-23
lines changed

5 files changed

+94
-23
lines changed
66.7 KB
Loading
110 KB
Loading
52.7 KB
Loading
142 KB
Loading

docs/ai_builder/integrations/databricks.md

Lines changed: 94 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,80 @@ tags: Data Infrastructure
33
description: Connect with Databricks to run data pipelines and advanced analytics seamlessly.
44
---
55

6+
67
# Databricks Integration
78

8-
The **Databricks Integration** allows your app to connect to a Databricks workspace, query data from warehouses, and use catalogs and schemas directly in your app. This integration supports secure authentication via tokens and can be configured per environment.
9+
The **Databricks Integration** allows your app to connect to [Databricks](https://www.databricks.com/) for secure data access, querying, and analytics. Once connected, you can run SQL queries, retrieve results, and power data-driven workflows directly from your app.
10+
11+
## What You Can Do
12+
13+
With Databricks, your app can:
14+
- Connect securely to your Databricks workspace.
15+
- Run **SQL queries** or fetch data programmatically.
16+
- Build **dashboards and data visualizations** on top of your Databricks tables.
17+
- Automate workflows triggered by new or updated data.
18+
- Combine Databricks with AI models for advanced analytics.
19+
920

1021
```python exec
1122
import reflex as rx
1223
from reflex_image_zoom import image_zoom
1324
```
1425

26+
27+
## Step 1: Get Your Databricks Credentials
28+
29+
1 - Log in to your [Databricks Workspace](https://databricks.com/).
30+
31+
2 - Get your **DATABRICKS_HOST** and **DATABRICKS_WAREHOUSE_ID**:
32+
- Go to `SQL Warehouses` from the sidebar.
33+
- Select your desired warehouse.
34+
- Click `Connection details`.
35+
- Copy the Server hostname (this is your **DATABRICKS_HOST**).
36+
- Copy the HTTP path removing the `/sql/1.0/warehouses/` prefix (this is your **DATABRICKS_WAREHOUSE_ID**).
37+
38+
39+
```python eval
40+
rx.el.div(
41+
image_zoom(
42+
rx.image(
43+
src="/ai_builder/integrations/databricks_integration_1.webp",
44+
class_name="p-2 rounded-md h-auto",
45+
border=f"0.81px solid {rx.color('slate', 5)}",
46+
),
47+
class_name="rounded-md overflow-hidden",
48+
),
49+
class_name="w-full flex flex-col rounded-md cursor-pointer",
50+
)
51+
```
52+
53+
3 - Generate a **Personal Access Token** (**DATABRICKS_TOKEN**):
54+
- Click on your profile icon → **Settings**.
55+
- Click **Developer**.
56+
- Click **Manage** in Access Tokens.
57+
- Click **Generate New Token**, provide a name and expiration, then copy it (**DATABRICKS_TOKEN**).
58+
59+
```python eval
60+
rx.el.div(
61+
image_zoom(
62+
rx.image(
63+
src="/ai_builder/integrations/databricks_integration_2.webp",
64+
class_name="p-2 rounded-md h-auto",
65+
border=f"0.81px solid {rx.color('slate', 5)}",
66+
),
67+
class_name="rounded-md overflow-hidden",
68+
),
69+
class_name="w-full flex flex-col rounded-md cursor-pointer",
70+
)
71+
```
72+
73+
74+
1575
```python eval
1676
rx.el.div(
1777
image_zoom(
1878
rx.image(
19-
src=rx.color_mode_cond(
20-
"/ai_builder/integrations/databricks_light.webp",
21-
"/ai_builder/integrations/databricks_dark.webp",
22-
),
79+
src="/ai_builder/integrations/databricks_integration_3.webp",
2380
class_name="p-2 rounded-md h-auto",
2481
border=f"0.81px solid {rx.color('slate', 5)}",
2582
),
@@ -29,30 +86,44 @@ rx.el.div(
2986
)
3087
```
3188

32-
## Step 1: Gather Your Credentials
89+
4 - Get your **DATABRICKS_CATALOG** and **DATABRICKS_SCHEMA**:
90+
- Click the SQL Editor from the sidebar.
91+
- Choose the **DATABRICKS_CATALOG** and **DATABRICKS_SCHEMA** from the dropdowns as shown below.
92+
93+
94+
```python eval
95+
rx.el.div(
96+
image_zoom(
97+
rx.image(
98+
src="/ai_builder/integrations/databricks_integration_4.webp",
99+
class_name="p-2 rounded-md h-auto",
100+
border=f"0.81px solid {rx.color('slate', 5)}",
101+
),
102+
class_name="rounded-md overflow-hidden",
103+
),
104+
class_name="w-full flex flex-col rounded-md cursor-pointer",
105+
)
106+
```
33107

34-
Before connecting, make sure you have the following information:
35108

36-
- **Hostname**: `https://adb-1234567890123456.7.azuredatabricks.net`
37-
*The URL of your Databricks workspace*
38109

39-
- **Personal Access Token**: `dapi1234567890abcdef1234567890abcd`
40-
*Used for secure authentication*
110+
## Step 2: Configure the Integration in Your App
41111

42-
- **Warehouse / SQL Endpoint ID**: `wh-9876543210`
43-
*The warehouse ID you want to query*
112+
1. In your app, go to **Integrations** and **Add Databricks**.
113+
2. Paste your
114+
1. **DATABRICKS_TOKEN**
115+
2. **DATABRICKS_HOST**
116+
3. **DATABRICKS_WAREHOUSE_ID**
117+
4. **DATABRICKS_CATALOG**
118+
5. **DATABRICKS_SCHEMA**
119+
3. Click **Connect** to validate and save your integration.
44120

45-
- **Catalog**: `databricks_catalog_demo`
46-
*The catalog containing your databases*
121+
Once connected, the AI Builder can execute queries directly against your Databricks environment.
47122

48-
- **Schema**: `demo_schema`
49-
*The schema inside the catalog to query*
50123

51-
> **Note:** Use environment-specific credentials for development, staging, and production.
124+
## Step 3: Notes
52125

53-
## Step 2: Configure the Integration
126+
* **Secure your token:** Never expose tokens in public code.
127+
* **Permissions:** Ensure your token or service account has the required workspace and table permissions.
128+
* **Combine with AI:** Use query outputs to power models, summaries, or alerts in real time.
54129

55-
1. Go to the **Integrations** section in your app settings by clicking **`@`** and then clicking the **Integrations** tab at the top.
56-
2. Click **Add Databricks Integration**.
57-
3. Fill in the fields using your credentials
58-
4. Save the integration. Your app can now access Databricks data securely.

0 commit comments

Comments
 (0)