Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
97b92e1
Added Databricks SQL Warehouses API actions
Lokeshchand33 Aug 22, 2025
5a697bd
Update Databricks SQL Warehouse docs URLs
Lokeshchand33 Aug 22, 2025
6623be2
Merge branch 'master' into databricks-sql-warehouses
Lokeshchand33 Aug 23, 2025
8343661
Merge branch 'master' into databricks-sql-warehouses
Lokeshchand33 Aug 27, 2025
9292e93
fix(databricks): bump component versions and apply lint fixes
Lokeshchand33 Aug 28, 2025
6a9646c
fix(databricks): addressed requested changes
Lokeshchand33 Aug 29, 2025
d66788b
addressed coderabbit review feedback
Lokeshchand33 Aug 29, 2025
e120588
resolved the linting issues
Lokeshchand33 Aug 29, 2025
5238430
Merge branch 'master' into databricks-sql-warehouses
Lokeshchand33 Aug 30, 2025
e742ec2
addressed all test failures
Lokeshchand33 Sep 1, 2025
01ed509
addressed coderabbit review feedback
Lokeshchand33 Sep 1, 2025
d83d206
Merge branch 'master' into databricks-sql-warehouses
Lokeshchand33 Sep 1, 2025
49e997c
resolved the linting issues
Lokeshchand33 Sep 1, 2025
0535802
addressed coderabbit review feedback
Lokeshchand33 Sep 1, 2025
b98476c
addressed coderabbit review feedback
Lokeshchand33 Sep 1, 2025
2153ac3
resolved the linting issues
Lokeshchand33 Sep 1, 2025
b04a050
updates
michelle0927 Sep 1, 2025
2222816
Add default value for maxNumClusters
vunguyenhung Sep 2, 2025
2aeacf2
create and edit sql warehouses fixes
Lokeshchand33 Sep 2, 2025
9bfe023
create and edit sql warehouse fixes
Lokeshchand33 Sep 2, 2025
99dfc76
updates
michelle0927 Sep 2, 2025
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,49 @@
import databricks from "../../databricks.app.mjs";

export default {
key: "databricks-create-sql-warehouse",
name: "Create SQL Warehouse",
description: "Creates a new SQL Warehouse in Databricks. [See the documentation](https://docs.databricks.com/api/workspace/warehouses/create)",
version: "0.0.1",
type: "action",
props: {
databricks,
name: {
type: "string",
label: "Warehouse Name",
description: "A human-readable name for the warehouse",
},
clusterSize: {
type: "string",
label: "Cluster Size",
description: "Size of the cluster (e.g., `Small`, `Medium`, `Large`)",
options: [
"Small",
"Medium",
"Large",
],
},
autoStopMinutes: {
type: "integer",
label: "Auto Stop (minutes)",
description: "Number of minutes of inactivity before the warehouse auto-stops",
optional: true,
default: 10,
},
},
async run({ $ }) {
const payload = {
name: this.name,
cluster_size: this.clusterSize,
auto_stop_mins: this.autoStopMinutes,
};

const response = await this.databricks.createSQLWarehouse({
data: payload,
$,
});

$.export("$summary", `Successfully created SQL Warehouse: ${response?.name || this.name}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import databricks from "../../databricks.app.mjs";

export default {
key: "databricks-delete-sql-warehouse",
name: "Delete SQL Warehouse",
description: "Deletes a SQL Warehouse by ID. [See the documentation](https://docs.databricks.com/api/workspace/warehouses/delete)",
version: "0.0.1",
type: "action",
props: {
databricks,
warehouseId: {
description: "The ID of the SQL Warehouse to delete",
propDefinition: [
databricks,
"warehouseId",
],
},
},
async run({ $ }) {
await this.databricks.deleteSQLWarehouse({
warehouseId: this.warehouseId,
$,
});

$.export("$summary", `Successfully deleted SQL Warehouse with ID ${this.warehouseId}`);
return {
success: true,
};
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
import databricks from "../../databricks.app.mjs";

export default {
key: "databricks-edit-sql-warehouse",
name: "Edit SQL Warehouse",
description: "Edits the configuration of an existing SQL Warehouse. [See docs](https://docs.databricks.com/api/workspace/warehouses/edit)",
version: "0.0.1",
type: "action",
props: {
databricks,
warehouseId: {
description: "The ID of the SQL Warehouse to edit",
propDefinition: [
databricks,
"warehouseId",
],
},
name: {
type: "string",
label: "Warehouse Name",
description: "Logical name for the warehouse. Must be unique within an org and under 100 characters.",
optional: true,
},
clusterSize: {
type: "string",
label: "Cluster Size",
description: "Size of clusters allocated for this warehouse.",
options: [
"2X-Small",
"X-Small",
"Small",
"Medium",
"Large",
"X-Large",
"2X-Large",
"3X-Large",
"4X-Large",
],
optional: true,
},
autoStopMins: {
type: "integer",
label: "Auto Stop (minutes)",
description: "Minutes of inactivity before auto-stop. 0 disables autostop. Must be 0 or ≥ 10.",
optional: true,
},
minNumClusters: {
type: "integer",
label: "Min Number of Clusters",
description: "Minimum number of available clusters (> 0 and ≤ min(max_num_clusters, 30)).",
optional: true,
},
maxNumClusters: {
type: "integer",
label: "Max Number of Clusters",
description: "Maximum number of clusters for autoscaler (≥ min_num_clusters and ≤ 30).",
optional: true,
},
enablePhoton: {
type: "boolean",
label: "Enable Photon",
description: "Use Photon optimized clusters.",
optional: true,
},
enableServerlessCompute: {
type: "boolean",
label: "Enable Serverless Compute",
description: "Use serverless compute for this warehouse.",
optional: true,
},
warehouseType: {
type: "string",
label: "Warehouse Type",
description: "Set to PRO (recommended) or CLASSIC. Set PRO + enable serverless to use serverless.",
options: [
"TYPE_UNSPECIFIED",
"CLASSIC",
"PRO",
],
optional: true,
},
spotInstancePolicy: {
type: "string",
label: "Spot Instance Policy",
description: "Whether the warehouse should use spot instances.",
options: [
"POLICY_UNSPECIFIED",
"COST_OPTIMIZED",
"RELIABILITY_OPTIMIZED",
],
optional: true,
},
tags: {
type: "object",
label: "Tags",
description: "Key-value tags for all resources associated with this warehouse (fewer than 45 tags).",
optional: true,
},
channel: {
type: "object",
label: "Channel",
description: "Channel details. Example: `{ \"name\": \"CHANNEL_NAME_CURRENT\", \"dbsql_version\": \"2023.35\" }`",
optional: true,
},
creatorName: {
type: "string",
label: "Creator Name",
description: "Warehouse creator name.",
optional: true,
},
instanceProfileArn: {
type: "string",
label: "Instance Profile ARN (Deprecated)",
description: "Deprecated. Instance profile used to pass IAM role to the cluster.",
optional: true,
},
},
async run({ $ }) {
const payload = {};
if (this.name) payload.name = this.name;
if (this.clusterSize) payload.cluster_size = this.clusterSize;
if (this.autoStopMins) payload.auto_stop_mins = this.autoStopMins;
if (this.minNumClusters) payload.min_num_clusters = this.minNumClusters;
if (this.maxNumClusters) payload.max_num_clusters = this.maxNumClusters;
if (this.enablePhoton) payload.enable_photon = this.enablePhoton;
if (this.enableServerlessCompute){
payload.enable_serverless_compute = this.enableServerlessCompute;
}
if (this.warehouseType) payload.warehouse_type = this.warehouseType;
if (this.spotInstancePolicy) payload.spot_instance_policy = this.spotInstancePolicy;
if (this.tags) payload.tags = this.tags;
if (this.channel) payload.channel = this.channel;
if (this.creatorName) payload.creator_name = this.creatorName;
if (this.instanceProfileArn) payload.instance_profile_arn = this.instanceProfileArn;
const response = await this.databricks.editSQLWarehouse({
warehouseId: this.warehouseId,
data: payload,
$,
});

$.export("$summary", `Successfully edited SQL Warehouse ID ${this.warehouseId}`);
return response;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "databricks-get-run-output",
name: "Get Run Output",
description: "Retrieve the output and metadata of a single task run. [See the documentation](https://docs.databricks.com/en/workflows/jobs/jobs-2.0-api.html#runs-get-output)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
databricks,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import databricks from "../../databricks.app.mjs";

export default {
key: "databricks-get-sql-warehouse-config",
name: "Get SQL Warehouse Config",
description: "Retrieves the global configuration for SQL Warehouses. [See docs](https://docs.databricks.com/api/workspace/warehouses/getworkspacewarehouseconfig)",
version: "0.0.1",
type: "action",
props: {
databricks,
},
async run({ $ }) {
const response = await this.databricks.getSQLWarehouseConfig({
$,
});
$.export("$summary", "Successfully retrieved SQL Warehouse configuration");
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import databricks from "../../databricks.app.mjs";

export default {
key: "databricks-get-sql-warehouse-permissions",
name: "Get SQL Warehouse Permissions",
description: "Retrieves the permissions for a specific SQL Warehouse. [See docs](https://docs.databricks.com/api/workspace/warehouses/getpermissions)",
version: "0.0.1",
type: "action",
props: {
databricks,
warehouseId: {
description: "The ID of the SQL Warehouse to fetch permissions for",
propDefinition: [
databricks,
"warehouseId",
],
},
},
async run({ $ }) {
const response = await this.databricks.getSQLWarehousePermissions({
warehouseId: this.warehouseId,
$,
});

$.export("$summary", `Retrieved permissions for SQL Warehouse ID ${this.warehouseId}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import databricks from "../../databricks.app.mjs";

export default {
key: "databricks-get-sql-warehouse",
name: "Get SQL Warehouse",
description: "Retrieves details for a specific SQL Warehouse. [See docs](https://docs.databricks.com/api/workspace/warehouses/get)",
version: "0.0.1",
type: "action",
props: {
databricks,
warehouseId: {
description: "The ID of the SQL Warehouse to retrieve",
propDefinition: [
databricks,
"warehouseId",
],
},
},
async run({ $ }) {
const response = await this.databricks.getSQLWarehouse({
warehouseId: this.warehouseId,
$,
});

$.export("$summary", `Retrieved details for SQL Warehouse ID ${this.warehouseId}`);
return response;
},
};
2 changes: 1 addition & 1 deletion components/databricks/actions/list-runs/list-runs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "databricks-list-runs",
name: "List Runs",
description: "Lists all runs available to the user. [See the documentation](https://docs.databricks.com/en/workflows/jobs/jobs-2.0-api.html#runs-list)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
databricks,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import databricks from "../../databricks.app.mjs";

export default {
key: "databricks-list-sql-warehouses",
name: "List SQL Warehouses",
description: "Lists all SQL Warehouses available in the Databricks workspace. [See the documentation](https://docs.databricks.com/api/workspace/warehouses/list)",
version: "0.0.1",
type: "action",
props: {
databricks,
},
async run({ $ }) {
const { warehouses } = await this.databricks.listSQLWarehouses({
$,
});

if (!warehouses?.length) {
$.export("$summary", "No warehouses found.");
return [];
}

$.export("$summary", `Successfully retrieved ${warehouses.length} warehouse${warehouses.length === 1
? ""
: "s"}.`);

return warehouses;
},
};
2 changes: 1 addition & 1 deletion components/databricks/actions/run-job-now/run-job-now.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "databricks-run-job-now",
name: "Run Job Now",
description: "Run a job now and return the id of the triggered run. [See the documentation](https://docs.databricks.com/en/workflows/jobs/jobs-2.0-api.html#runs-list)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
databricks,
Expand Down
Loading