Skip to content

Commit c8cdb2e

Browse files
update modified status
1 parent 53b4d3c commit c8cdb2e

File tree

2 files changed

+151
-35
lines changed

2 files changed

+151
-35
lines changed

acceptance/bundle/summary/modified_status/databricks.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ resources:
2121
alerts:
2222
my_alert:
2323
display_name: test-alert
24-
query_text: "SELECT 1"
25-
warehouse_id: "test-sql-warehouse"
26-
custom_summary: "test-alert-summary"
27-
custom_description: "test-alert-description"
24+
evaluation:
25+
comparison_operator: EQUAL
26+
source:
27+
name: "1"
28+
threshold:
29+
value:
30+
double_value: 2
31+
query_text: select 2
32+
schedule:
33+
quartz_cron_schedule: "44 19 */1 * * ?"
34+
timezone_id: Europe/Amsterdam
35+
warehouse_id: aaaaaaaaaaaaaaaa

acceptance/bundle/summary/modified_status/output.txt

Lines changed: 139 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11

22
=== Initial view of resources without id and modified_status=created
33
>>> [CLI] bundle summary -o json
4-
Warning: required field "evaluation" is not set
5-
at resources.alerts.my_alert
6-
in databricks.yml:6:7
7-
8-
Warning: required field "schedule" is not set
9-
at resources.alerts.my_alert
10-
in databricks.yml:6:7
11-
124
{
135
"alerts": {
146
"my_alert": {
15-
"custom_description": "test-alert-description",
16-
"custom_summary": "test-alert-summary",
177
"display_name": "test-alert",
8+
"evaluation": {
9+
"comparison_operator": "EQUAL",
10+
"source": {
11+
"name": "1"
12+
},
13+
"threshold": {
14+
"value": {
15+
"double_value": 2
16+
}
17+
}
18+
},
1819
"modified_status": "created",
1920
"parent_path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/resources",
20-
"query_text": "SELECT 1",
21-
"warehouse_id": "test-sql-warehouse"
21+
"query_text": "select 2",
22+
"schedule": {
23+
"quartz_cron_schedule": "44 19 */1 * * ?",
24+
"timezone_id": "Europe/Amsterdam"
25+
},
26+
"warehouse_id": "aaaaaaaaaaaaaaaa"
2227
}
2328
},
2429
"pipelines": {
@@ -63,31 +68,134 @@ Warning: required field "schedule" is not set
6368
}
6469

6570
>>> [CLI] bundle deploy
66-
Warning: required field "evaluation" is not set
67-
at resources.alerts.my_alert
68-
in databricks.yml:6:7
69-
70-
Warning: required field "schedule" is not set
71-
at resources.alerts.my_alert
72-
in databricks.yml:6:7
73-
7471
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
75-
Error: exit status 1
72+
Deploying resources...
73+
Updating deployment state...
74+
Deployment complete!
7675

77-
Error: Missing required argument
78-
79-
on bundle.tf.json line 22, in resource.databricks_alert_v2.my_alert:
80-
22: }
76+
=== Post-deployment view of resources with id and without modified_status
77+
>>> [CLI] bundle summary -o json
78+
{
79+
"alerts": {
80+
"my_alert": {
81+
"display_name": "test-alert",
82+
"evaluation": {
83+
"comparison_operator": "EQUAL",
84+
"source": {
85+
"name": "1"
86+
},
87+
"threshold": {
88+
"value": {
89+
"double_value": 2
90+
}
91+
}
92+
},
93+
"id": "[UUID]",
94+
"parent_path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/resources",
95+
"query_text": "select 2",
96+
"schedule": {
97+
"quartz_cron_schedule": "44 19 */1 * * ?",
98+
"timezone_id": "Europe/Amsterdam"
99+
},
100+
"url": "[DATABRICKS_URL]/sql/alerts-v2/[UUID]?o=[NUMID]",
101+
"warehouse_id": "aaaaaaaaaaaaaaaa"
102+
}
103+
},
104+
"pipelines": {
105+
"my_pipeline": {
106+
"channel": "CURRENT",
107+
"deployment": {
108+
"kind": "BUNDLE",
109+
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/metadata.json"
110+
},
111+
"edition": "ADVANCED",
112+
"id": "[UUID]",
113+
"libraries": [
114+
{
115+
"file": {
116+
"path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/foo.py"
117+
}
118+
}
119+
],
120+
"name": "test-pipeline",
121+
"url": "[DATABRICKS_URL]/pipelines/[UUID]?o=[NUMID]"
122+
}
123+
},
124+
"schemas": {
125+
"my_schema": {
126+
"catalog_name": "main",
127+
"comment": "COMMENT1",
128+
"id": "main.test-schema",
129+
"name": "test-schema",
130+
"url": "[DATABRICKS_URL]/explore/data/main/test-schema?o=[NUMID]"
131+
}
132+
},
133+
"sql_warehouses": {
134+
"my_sql_warehouse": {
135+
"auto_stop_mins": 120,
136+
"cluster_size": "X-Large",
137+
"enable_photon": true,
138+
"enable_serverless_compute": true,
139+
"id": "[UUID]",
140+
"max_num_clusters": 1,
141+
"name": "test-sql-warehouse",
142+
"spot_instance_policy": "COST_OPTIMIZED",
143+
"url": "[DATABRICKS_URL]/sql/warehouses/[UUID]?o=[NUMID]"
144+
}
145+
}
146+
}
81147

82-
The argument "evaluation" is required, but no definition was found.
148+
=== Expecting all resources to have modified_status=deleted
149+
>>> [CLI] bundle summary -o json
150+
{
151+
"alerts": {
152+
"my_alert": {
153+
"id": "[UUID]",
154+
"modified_status": "deleted",
155+
"url": "[DATABRICKS_URL]/sql/alerts-v2/[UUID]?o=[NUMID]"
156+
}
157+
},
158+
"pipelines": {
159+
"my_pipeline": {
160+
"id": "[UUID]",
161+
"modified_status": "deleted",
162+
"url": "[DATABRICKS_URL]/pipelines/[UUID]?o=[NUMID]"
163+
}
164+
},
165+
"schemas": {
166+
"my_schema": {
167+
"id": "main.test-schema",
168+
"modified_status": "deleted",
169+
"url": "[DATABRICKS_URL]/explore/data/main/test-schema?o=[NUMID]"
170+
}
171+
},
172+
"sql_warehouses": {
173+
"my_sql_warehouse": {
174+
"id": "[UUID]",
175+
"modified_status": "deleted",
176+
"url": "[DATABRICKS_URL]/sql/warehouses/[UUID]?o=[NUMID]"
177+
}
178+
}
179+
}
83180

84-
Error: Missing required argument
181+
>>> [CLI] bundle destroy --auto-approve
182+
The following resources will be deleted:
183+
delete resources.alerts.my_alert
184+
delete resources.pipelines.my_pipeline
185+
delete resources.schemas.my_schema
186+
delete resources.sql_warehouses.my_sql_warehouse
85187

86-
on bundle.tf.json line 22, in resource.databricks_alert_v2.my_alert:
87-
22: }
188+
This action will result in the deletion of the following UC schemas. Any underlying data may be lost:
189+
delete resources.schemas.my_schema
88190

89-
The argument "schedule" is required, but no definition was found.
191+
This action will result in the deletion of the following Lakeflow Declarative Pipelines along with the
192+
Streaming Tables (STs) and Materialized Views (MVs) managed by them:
193+
delete resources.pipelines.my_pipeline
90194

195+
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default
91196

197+
Deleting files...
198+
Destroy complete!
92199

93-
Exit code: 1
200+
>>> [CLI] bundle summary -o json
201+
{}

0 commit comments

Comments
 (0)