Skip to content

[BUG] Quarto auth behaviour on Posit Workbench #139

@zacdav-db

Description

@zacdav-db

@zacdav-db based on my somewhat limited testing things worked as expected in Posit Workbench.

I did, however, have an issue connecting, using the code below, when running in Quarto

sc <- sparklyr::spark_connect(method     = "databricks_connect",
                              master     = databricks_host,
                              serverless = TRUE,
                              version    = "15.1")

The code fails because when you run Quarto it shells out to a command-line R session which is technically no longer an RStudio session and therefore does not have access to the .rs.api.

I think you can fix this by using the databricks.sdk.core.Config function to retrieve the Databricks OAuth token e.g.,

db_sdk_core <- import_check("databricks.sdk.core", envname, silent = TRUE)
 
config <- db_sdk_core$Config(profile="workbench")
token <- config.token

I think you would need to update this function in pysparklyr - https://github.com/zacdav-db/pysparklyr/blob/oauth/R/databricks-utils.R#L34

Originally posted by @edwardsd in #127 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions