Skip to content

Commit 2aeacf2

Browse files
committed
create and edit sql warehouses fixes
1 parent 2222816 commit 2aeacf2

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

components/databricks/actions/create-sql-warehouse/create-sql-warehouse.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,18 @@ export default {
133133
}
134134

135135
const parsedTags = utils.parseObject(this.tags);
136-
const tags = Object.entries(parsedTags).map(([
136+
const tagArray = Object.entries(parsedTags).map(([
137137
key,
138138
value,
139139
]) => ({
140140
key,
141141
value,
142142
}));
143+
if (tagArray.length) {
144+
payload.tags = {
145+
custom_tags: tagArray,
146+
};
147+
}
143148

144149
if (this.enablePhoton !== undefined)
145150
payload.enable_photon = this.enablePhoton;
@@ -149,7 +154,6 @@ export default {
149154
if (this.spotInstancePolicy)
150155
payload.spot_instance_policy = this.spotInstancePolicy;
151156
if (this.channel) payload.channel = utils.parseObject(this.channel);
152-
if (tags.length) payload.tags = tags;
153157
if (this.instanceProfileArn)
154158
payload.instance_profile_arn = this.instanceProfileArn;
155159

components/databricks/actions/edit-sql-warehouse/edit-sql-warehouse.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,20 @@ export default {
146146
}
147147

148148
const parsedTags = utils.parseObject(this.tags);
149-
const tags = Object.entries(parsedTags).map(([
149+
const tagArray = Object.entries(parsedTags).map(([
150150
key,
151151
value,
152152
]) => ({
153153
key,
154154
value,
155155
}));
156-
156+
if (tagArray.length) {
157+
payload.tags = { custom_tags: tagArray };
158+
}
157159
if (this.warehouseType !== undefined) payload.warehouse_type = this.warehouseType;
158160
if (this.spotInstancePolicy !== undefined) {
159161
payload.spot_instance_policy = this.spotInstancePolicy;
160162
}
161-
if (tags.length) payload.tags = tags;
162163
if (this.channel !== undefined) payload.channel = utils.parseObject(this.channel);
163164
if (this.instanceProfileArn !== undefined) {
164165
payload.instance_profile_arn = this.instanceProfileArn;

0 commit comments

Comments
 (0)