Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: brickster
Title: R Toolkit for 'Databricks'
Version: 0.2.13.9000
Version: 0.2.14
Authors@R: c(
person("Zac", "Davies", , "zac@databricks.com", role = c("aut", "cre")),
person("Rafi", "Kurlansik", , "rafi.kurlansik@databricks.com", role = "aut"),
Expand Down
34 changes: 17 additions & 17 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# brickster (development version)

- Fixed OAuth U2M and M2M authentication across multiple Databricks workspaces in one R session by isolating OAuth clients and cached tokens per workspace (#255)
- OAuth tokens are now refreshed 40 seconds before expiry, avoiding Databricks API rejections during the final 30 seconds of a token's lifetime; this requires `{httr2}` 1.3.0 or later (#257)
- Added `databricks-cli` authentication support for profiles created by `databricks auth login`; `{brickster}` obtains tokens through `databricks auth token`, caches only the short-lived access token in memory, and leaves durable credentials and refresh to the CLI (#253)
- Authentication mode overrides now come from `auth_type` in the selected `.databrickscfg` profile; replace `DATABRICKS_AUTH_TYPE` with the profile field. Environment-only authentication continues to infer the mode from available credentials.
- Fixed `dbWriteTable()` and `dbAppendTable()` standard-path writes for binary columns, which now use Databricks `BINARY` types and `X'...'` literals when no staging volume is configured (#245)
- `dbConnect()` now preserves Databricks API error details when its validation query fails
- `db_perform_request()` and `db_perform_response()` now preserve useful error messages when Databricks returns non-JSON error bodies such as empty, plain-text, or HTML responses (#242)
- Fixed `git_source()` erroring when `type` was left at its default
- Fixed Unity Catalog volume file requests so `db_volume_*` paths containing spaces are encoded correctly (#231)
- `db_cluster_events()` now forwards the `event_types` argument to the API, which was previously ignored
- `db_sql_warehouse_create()` and `db_sql_warehouse_edit()` now forward the `tags` argument to the API, which was previously ignored
- Unity Catalog list helpers now preserve `next_page_token` metadata in list responses for catalogs, schemas, tables, and volumes; their list arguments are sent as documented query parameters
- `db_uc_volumes_list()` now forwards the `max_results`, `include_browse`, and `page_token` arguments to the API, which were previously ignored
- `db_vs_indexes_query()` now sends the `score_threshold` argument to the API, which was previously ignored
- Added `show_progress` to `dbConnect()` for the DBI backend; `dbGetQuery()`, `dbFetch()`, `dbWriteTable()`, and dbplyr `collect()` now use the connection default while preserving per-call `show_progress` overrides (#223)
# brickster 0.2.14

- Fixed OAuth U2M and M2M authentication across multiple Databricks workspaces in one R session by isolating OAuth clients and cached tokens per workspace (#256, @zacdav-db)
- OAuth tokens are now refreshed 40 seconds before expiry, avoiding Databricks API rejections during the final 30 seconds of a token's lifetime; this requires `{httr2}` 1.3.0 or later (#258, @zacdav-db)
- Added `databricks-cli` authentication support for profiles created by `databricks auth login`; `{brickster}` obtains tokens through `databricks auth token`, caches only the short-lived access token in memory, and leaves durable credentials and refresh to the CLI (#258, @zacdav-db)
- Authentication mode overrides now come from `auth_type` in the selected `.databrickscfg` profile; replace `DATABRICKS_AUTH_TYPE` with the profile field. Environment-only authentication continues to infer the mode from available credentials (#258, @zacdav-db)
- Fixed `dbWriteTable()` and `dbAppendTable()` standard-path writes for binary columns, which now use Databricks `BINARY` types and `X'...'` literals when no staging volume is configured (#246, @zacdav-db)
- `dbConnect()` now preserves Databricks API error details when its validation query fails (#247, @zacdav)
- `db_perform_request()` and `db_perform_response()` now preserve useful error messages when Databricks returns non-JSON error bodies such as empty, plain-text, or HTML responses (#247, @zacdav)
- Fixed `git_source()` erroring when `type` was left at its default (#225, @m-muecke)
- Fixed Unity Catalog volume file requests so `db_volume_*` paths containing spaces are encoded correctly (#233, @zacdav-db)
- `db_cluster_events()` now forwards the `event_types` argument to the API, which was previously ignored (#236, @m-muecke)
- `db_sql_warehouse_create()` and `db_sql_warehouse_edit()` now forward the `tags` argument to the API, which was previously ignored (#240, @m-muecke)
- Unity Catalog list helpers now preserve `next_page_token` metadata in list responses for catalogs, schemas, tables, and volumes; their list arguments are sent as documented query parameters (#244, @zacdav-db)
- `db_uc_volumes_list()` now forwards the `max_results`, `include_browse`, and `page_token` arguments to the API, which were previously ignored (#228, @m-muecke)
- `db_vs_indexes_query()` now sends the `score_threshold` argument to the API, which was previously ignored (#235, @m-muecke)
- Added `show_progress` to `dbConnect()` for the DBI backend; `dbGetQuery()`, `dbFetch()`, `dbWriteTable()`, and dbplyr `collect()` now use the connection default while preserving per-call `show_progress` overrides (#223, @zacdav-db)

# brickster 0.2.13

Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ warehouses <- db_sql_warehouse_list()

Refer to the ["Connect to a Databricks Workspace"](https://databrickslabs.github.io/brickster/articles/setup-auth.html) article for more details on getting authentication configured.

If you already authenticated with a profile created by `databricks auth login`,
`{brickster}` can reuse its short-lived OAuth credentials:

``` r
options(
use_databrickscfg = TRUE,
db_profile = "<profile-name>"
)
```

## Usage

### `{DBI}` Backend
Expand Down Expand Up @@ -141,4 +151,4 @@ pak::pak("databrickslabs/brickster")
| [REST 1.2 Commands](https://docs.databricks.com/api/workspace/commandexecution) | Partially | 1.2 |
| [Unity Catalog - Tables](https://docs.databricks.com/api/workspace/tables) | Yes | 2.1 |
| [Unity Catalog - Volumes](https://docs.databricks.com/api/workspace/volumes) | Yes | 2.1 |
| [Unity Catalog](https://docs.databricks.com/api/workspace/catalogs) | Partially | 2.1 |
| [Unity Catalog](https://docs.databricks.com/api/workspace/catalogs) | Partially | 2.1 |
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

0 errors | 0 warnings | 0 notes

* This is a new release.
* This is an updated release.
30 changes: 0 additions & 30 deletions tests/testthat/test-request-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,36 +140,6 @@ test_that("request helpers - m2m auth flow", {
expect_identical(req$policies$auth_sign$params$expiry_margin, 40)
})

test_that("request helpers - u2m auth flow", {
local_clear_auth_env()
withr::local_envvar(c(
DATABRICKS_CLIENT_ID = NA_character_,
DATABRICKS_CLIENT_SECRET = NA_character_
))
local_mocked_bindings(
is_hosted_session = function() FALSE,
.package = "brickster"
)
local_mocked_bindings(
is_interactive = function() TRUE,
.package = "rlang"
)

req <- db_request(
endpoint = "clusters/list",
method = "GET",
version = "2.0",
host = "workspace.example.com",
token = NULL
)

expect_identical(
req$policies$auth_sign$params$flow,
"oauth_flow_auth_code"
)
expect_identical(req$policies$auth_sign$params$expiry_margin, 40)
})

test_that("request helpers isolate OAuth clients and tokens by workspace", {
local_clear_auth_env()

Expand Down