Skip to content

Commit b48fc0e

Browse files
zacdav-dbZac Davies
andauthored
SQL Query API + Job Updates (#104)
* Add new job tasks, add support for run_if, change to 2.2 API * docs and tests * adjusting job tests, docs for new job tasks, data security mode added. * fixing issue with SQL tasks, minor edits to vignette * Added SQL queries API coverage + tests, SQL task fixes. * Updating NEWS.md and pkgdown.yml --------- Co-authored-by: Zac Davies <[email protected]>
1 parent 3d3f696 commit b48fc0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1454
-171
lines changed

NAMESPACE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export(azure_attributes)
99
export(close_workspace)
1010
export(cluster_autoscale)
1111
export(cluster_log_conf)
12+
export(condition_task)
1213
export(cron_schedule)
1314
export(db_cluster_create)
1415
export(db_cluster_delete)
@@ -76,6 +77,11 @@ export(db_mlflow_model_version_comment)
7677
export(db_mlflow_model_version_comment_delete)
7778
export(db_mlflow_model_version_comment_edit)
7879
export(db_mlflow_registered_model_details)
80+
export(db_query_create)
81+
export(db_query_delete)
82+
export(db_query_get)
83+
export(db_query_list)
84+
export(db_query_update)
7985
export(db_read_netrc)
8086
export(db_repl)
8187
export(db_repo_create)
@@ -160,6 +166,7 @@ export(email_notifications)
160166
export(embedding_source_column)
161167
export(embedding_vector_column)
162168
export(file_storage_info)
169+
export(for_each_task)
163170
export(gcp_attributes)
164171
export(get_and_start_cluster)
165172
export(get_and_start_warehouse)
@@ -174,6 +181,7 @@ export(is.aws_attributes)
174181
export(is.azure_attributes)
175182
export(is.cluster_autoscale)
176183
export(is.cluster_log_conf)
184+
export(is.condition_task)
177185
export(is.cron_schedule)
178186
export(is.dbfs_storage_info)
179187
export(is.delta_sync_index)
@@ -183,6 +191,7 @@ export(is.email_notifications)
183191
export(is.embedding_source_column)
184192
export(is.embedding_vector_column)
185193
export(is.file_storage_info)
194+
export(is.for_each_task)
186195
export(is.gcp_attributes)
187196
export(is.git_source)
188197
export(is.init_script_info)
@@ -199,10 +208,13 @@ export(is.new_cluster)
199208
export(is.notebook_task)
200209
export(is.pipeline_task)
201210
export(is.python_wheel_task)
211+
export(is.run_job_task)
202212
export(is.s3_storage_info)
203213
export(is.spark_jar_task)
204214
export(is.spark_python_task)
205215
export(is.spark_submit_task)
216+
export(is.sql_file_task)
217+
export(is.sql_query_task)
206218
export(is.valid_task_type)
207219
export(is.vector_search_index_spec)
208220
export(job_task)
@@ -220,10 +232,13 @@ export(open_workspace)
220232
export(pipeline_task)
221233
export(python_wheel_task)
222234
export(remove_lib_path)
235+
export(run_job_task)
223236
export(s3_storage_info)
224237
export(spark_jar_task)
225238
export(spark_python_task)
226239
export(spark_submit_task)
240+
export(sql_file_task)
241+
export(sql_query_task)
227242
export(wait_for_lib_installs)
228243
import(cli)
229244
import(httr2)

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# brickster 0.2.8
22

3+
* Added SQL Queries API coverage
4+
* Updated Jobs to 2.2
5+
* Added additional tasks for jobs: `for_each_task`, `condition_task`, `sql_query_task`, `sql_file_task`, `run_job_task`
36
* Removing the Python SQL connector as `db_sql_query` supersedes it.
47
* Added `db_sql_query` to simplify execution of SQL
58
* Adjusted `db_repl` to handle mulit-line expressions (R only)

R/clusters.R

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
#' encryption of disks locally attached to the cluster is enabled.
6969
#' @param docker_image Instance of [docker_image()].
7070
#' @param policy_id String, ID of a cluster policy.
71+
#' @param kind The kind of compute described by this compute specification.
72+
#' @param data_security_mode Data security mode decides what data governance
73+
#' model to use when accessing data from a cluster.
7174
#' @inheritParams auth_params
7275
#' @inheritParams db_sql_warehouse_create
7376
#'
@@ -114,6 +117,19 @@ db_cluster_create <- function(
114117
enable_local_disk_encryption = TRUE,
115118
docker_image = NULL,
116119
policy_id = NULL,
120+
kind = c("CLASSIC_PREVIEW"),
121+
data_security_mode = c(
122+
"NONE",
123+
"SINGLE_USER",
124+
"USER_ISOLATION",
125+
"LEGACY_TABLE_ACL",
126+
"LEGACY_PASSTHROUGH",
127+
"LEGACY_SINGLE_USER",
128+
"LEGACY_SINGLE_USER_STANDARD",
129+
"DATA_SECURITY_MODE_STANDARD",
130+
"DATA_SECURITY_MODE_DEDICATED",
131+
"DATA_SECURITY_MODE_AUTO"
132+
),
117133
host = db_host(),
118134
token = db_token(),
119135
perform_request = TRUE
@@ -124,6 +140,9 @@ db_cluster_create <- function(
124140
# - all values in init_scripts must be from init_script_info() (class: InitScriptInfo)
125141
# - if specified, docker_image must be of class DockerImage
126142

143+
kind <- match.arg(kind)
144+
data_security_mode <- match.arg(data_security_mode)
145+
127146
body <- list(
128147
cluster_name = name,
129148
spark_version = spark_version,
@@ -143,7 +162,9 @@ db_cluster_create <- function(
143162
apply_policy_default_values = apply_policy_default_values,
144163
enable_local_disk_encryption = enable_local_disk_encryption,
145164
docker_image = docker_image,
146-
policy_id = policy_id
165+
policy_id = policy_id,
166+
data_security_mode = data_security_mode,
167+
kind = kind
147168
)
148169

149170
if (is.null(num_workers)) {
@@ -229,6 +250,19 @@ db_cluster_edit <- function(
229250
enable_local_disk_encryption = NULL,
230251
docker_image = NULL,
231252
policy_id = NULL,
253+
kind = c("CLASSIC_PREVIEW"),
254+
data_security_mode = c(
255+
"NONE",
256+
"SINGLE_USER",
257+
"USER_ISOLATION",
258+
"LEGACY_TABLE_ACL",
259+
"LEGACY_PASSTHROUGH",
260+
"LEGACY_SINGLE_USER",
261+
"LEGACY_SINGLE_USER_STANDARD",
262+
"DATA_SECURITY_MODE_STANDARD",
263+
"DATA_SECURITY_MODE_DEDICATED",
264+
"DATA_SECURITY_MODE_AUTO"
265+
),
232266
host = db_host(),
233267
token = db_token(),
234268
perform_request = TRUE
@@ -242,6 +276,8 @@ db_cluster_edit <- function(
242276
# - if specified, log_conf must be of class ClusterLogConf
243277
# - all values in init_scripts must be from init_script_info() (class: InitScriptInfo)
244278
# - if specified, docker_image must be of class DockerImage
279+
kind <- match.arg(kind)
280+
data_security_mode <- match.arg(data_security_mode)
245281

246282
body <- list(
247283
cluster_id = cluster_id,
@@ -263,7 +299,9 @@ db_cluster_edit <- function(
263299
apply_policy_default_values = apply_policy_default_values,
264300
enable_local_disk_encryption = enable_local_disk_encryption,
265301
docker_image = docker_image,
266-
policy_id = policy_id
302+
policy_id = policy_id,
303+
data_security_mode = data_security_mode,
304+
kind = kind
267305
)
268306

269307
if (!(is.null(num_workers) && is.null(autoscale))) {

0 commit comments

Comments
 (0)