Skip to content

Commit

Permalink
Merge pull request #12 from alexmalins/add-oauth-m2m-authentication
Browse files Browse the repository at this point in the history
Release 0.4.0
  • Loading branch information
alexmalins authored Sep 1, 2024
2 parents c525659 + 041de98 commit d6398c1
Show file tree
Hide file tree
Showing 8 changed files with 653 additions and 358 deletions.
6 changes: 3 additions & 3 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Note if you have a question about usage or a feature request, use the Discussion

#### Environment

OS version: <!-- Windows 10/Linux/macOS etc. -->
OS version: <!-- Windows 11/Linux/macOS etc. -->
Python version: <!-- 3.8/3.9/3.10/3.11/3.12 -->
harlequin-databricks version: <!-- ex. 0.3.1 -->
harlequin version: <!-- ex. 1.23.1 -->
harlequin-databricks version: <!-- ex. 0.4.0 -->
harlequin version: <!-- ex. 1.24.0 -->
Installed via: <!-- pip/conda-forge -->


Expand Down
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

## [0.4.0] - 2024-09-01

## Features

- Add support for cancelling queries mid-flight. Requires Harlequin `>=1.24.0` which introduced
the "Cancel Query" button.
- Add support for Azure in OAuth user-to-machine authentication for Databricks running on Azure.
- Add support for OAuth machine-to-machine (M2M) authentication to Databricks. This allows you to
use service principle credentials to connect to Databricks via Harlequin, useful for testing. To
use OAuth M2M, supply a `--client-id` and a `--client-secret` (i.e. a service principle OAuth
token) via CLI arguments.
- Better error handling and debug messages when database query errors occur.

## [0.3.1] - 2024-08-04

- Fix `UnicodeDecodeError` on Windows due to incorrectly attempting to read `functions.csv` using
Expand Down Expand Up @@ -61,7 +74,9 @@ is the one written with hyphens not underscores.

- Adds a Databricks adapter for SQL warehouses and DBR interactive clusters.

[Unreleased]: https://github.com/alexmalins/harlequin-databricks/compare/0.3.1...HEAD
[Unreleased]: https://github.com/alexmalins/harlequin-databricks/compare/0.4.0...HEAD

[0.4.0]: https://github.com/alexmalins/harlequin-databricks/compare/0.3.1...0.4.0

[0.3.1]: https://github.com/alexmalins/harlequin-databricks/compare/0.3.0...0.3.1

Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,22 @@ Authentication is also possible using a username and password (known as basic au
harlequin -a databricks --server-hostname my_databricks.cloud.databricks.com --http-path /sql/1.0/endpoints/1234567890abcdef --username my_user --password my_pass
```

Or by using [OAuth user-to-machine (U2M) authentication](https://docs.databricks.com/en/dev-tools/python-sql-connector.html#auth-u2m):
Or by using [OAuth user-to-machine (U2M) authentication](https://docs.databricks.com/en/dev-tools/python-sql-connector.html#auth-u2m)
- supply `databricks-oauth` or `azure-oauth` to the `--auth-type` CLI argument:

```bash
harlequin -a databricks --server-hostname my_databricks.cloud.databricks.com --http-path /sql/1.0/endpoints/1234567890abcdef --auth-type databricks-oauth
```

Or via [OAuth machine-to-machine (M2M) authentication](https://docs.databricks.com/en/dev-tools/python-sql-connector.html#oauth-machine-to-machine-m2m-authentication),
which also requires you `pip install databricks-sdk` as an additional dependency
([databricks-sdk](https://github.com/databricks/databricks-sdk-py) is an optional dependency of
`harlequin-databricks`):

```bash
harlequin -a databricks --server-hostname my_databricks.cloud.databricks.com --http-path /sql/1.0/endpoints/1234567890abcdef --client-id *** --client-secret ***
```

For more details on command line options, run:

```bash
Expand Down
705 changes: 403 additions & 302 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "harlequin-databricks"
version = "0.3.1"
version = "0.4.0"
description = "A Harlequin adapter for Databricks."
authors = [
"Zach Shirah <[email protected]>",
Expand All @@ -20,14 +20,18 @@ databricks = "harlequin_databricks:HarlequinDatabricksAdapter"

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
harlequin = "^1.17"
harlequin = "^1.24.0"
databricks-sql-connector = "^3.0.3"
databricks-sdk = { version = ">=0.30.0", optional = true }

[tool.poetry.extras]
databricks-sdk = ["databricks-sdk"]

[tool.poetry.group.dev.dependencies]
black = "^24.8.0"
ruff = "^0.5"
ruff = "^0.6.3"
pytest = ">=7.3.1,<9.0.0"
mypy = "^1.11.0"
mypy = "^1.11.2"
pre-commit = "^3.5.0"
importlib_metadata = { version = ">=8.0", python = "<3.10.0" }
beautifulsoup4 = "^4.12.0"
Expand Down
Loading

0 comments on commit d6398c1

Please sign in to comment.