Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop python 3.8 support #17

Merged
merged 6 commits into from
Jan 7, 2025
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
4 changes: 2 additions & 2 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Note if you have a question about usage or a feature request, use the Discussion
#### Environment

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

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/code_quality_tests_ubuntu_masos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest']
python-version: ['3.8', '3.12']
python-version: ['3.9', '3.12']
defaults:
run:
shell: bash
Expand Down Expand Up @@ -54,8 +54,8 @@ jobs:
- name: Check types with mypy
run: |
source $VENV
mypy .
if: ${{ matrix.python-version == '3.8' }}
mypy . --strict
if: ${{ matrix.python-version == '3.9' }}
- name: Check types with mypy
run: |
source $VENV
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests_windows_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: ['windows-latest']
python-version: ['3.9', '3.10', '3.11', '3.12']
timeout-minutes: 5

steps:
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.5.2] - 2025-01-07

### Breaking Changes
- Drops support for Python 3.8 (#17).
- Require latest versions of Harlequin `>=1.25.2`, databricks-sql-connector `>=3.7.0` and
databricks-sdk `>=0.40.0` (optional extra), and avoid upper version bounds on requirements to avoid
dependency hell (more here: https://github.com/databricks/databricks-sql-python/pull/452 &
https://github.com/tconbeer/harlequin/pull/714/commits/a50dfacd17e6626002c21e3c3bfd7e80203a0ea8#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R64)
(#17).

### Code Quality
- Reduce unused mypy ignores (#17).

## [0.5.1] - 2024-09-21

### Bug Fixes
Expand Down Expand Up @@ -92,7 +105,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.5.1...HEAD
[Unreleased]: https://github.com/alexmalins/harlequin-databricks/compare/0.5.2...HEAD

[0.5.2]: https://github.com/alexmalins/harlequin-databricks/compare/0.5.1...0.5.2

[0.5.1]: https://github.com/alexmalins/harlequin-databricks/compare/0.5.0...0.5.1

Expand Down
1,624 changes: 882 additions & 742 deletions poetry.lock

Large diffs are not rendered by default.

39 changes: 19 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "harlequin-databricks"
version = "0.5.1"
version = "0.5.2"
description = "A Harlequin adapter for Databricks."
authors = [
"Zach Shirah <[email protected]>",
Expand All @@ -19,28 +19,27 @@ packages = [
databricks = "harlequin_databricks:HarlequinDatabricksAdapter"

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

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

[tool.poetry.group.dev.dependencies]
black = "^24.8.0"
ruff = "^0.6.3"
pytest = ">=7.3.1,<9.0.0"
mypy = "^1.11.2"
pre-commit = "^3.5.0"
black = ">=24.10.0"
ruff = ">=0.8.6"
pytest = ">=7.3.1,"
mypy = ">=1.14.1"
importlib_metadata = { version = ">=8.0", python = "<3.10.0" }
beautifulsoup4 = "^4.12.0"
types-beautifulsoup4 = "^4.12.0.0"
lxml = "^5.2.2"
pandas = "^2.0.0"
pandas-stubs = "^2.0.0.230412"
requests = "^2.32.0"
types-requests = "^2.32.0.20240712"
beautifulsoup4 = ">=4.12.0"
types-beautifulsoup4 = ">=4.12.0.0"
lxml = ">=5.2.2"
pandas = ">=2.0.0"
pandas-stubs = ">=2.0.0.230412"
requests = ">=2.32.0"
types-requests = ">=2.32.0.20240712"

[tool.poetry.urls]
Changelog = "https://github.com/alexmalins/harlequin-databricks/blob/main/CHANGELOG.md"
Expand All @@ -52,14 +51,14 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.ruff]
select = ["A", "B", "E", "F", "I"]
target-version = "py38"
lint.select = ["A", "B", "E", "F", "I"]
target-version = "py39"

[tool.ruff.lint.pycodestyle]
max-line-length = 100

[tool.mypy]
python_version = "3.8"
python_version = "3.9"
files = [
"src/**/*.py",
"tests/**/*.py",
Expand Down
8 changes: 4 additions & 4 deletions src/harlequin_databricks/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from typing import Any

import pyarrow.compute as pc # type:ignore
from databricks import sql as databricks_sql # type:ignore
from databricks.sql.client import Cursor as DatabricksCursor # type:ignore
from databricks import sql as databricks_sql
from databricks.sql.client import Cursor as DatabricksCursor
from harlequin import (
HarlequinAdapter,
HarlequinConnection,
Expand Down Expand Up @@ -133,11 +133,11 @@ def __init__(
)

try:
from databricks.sdk.core import ( # type:ignore
from databricks.sdk.core import (
Config,
oauth_service_principal,
)
from databricks.sdk.credentials_provider import ( # type:ignore
from databricks.sdk.credentials_provider import (
CredentialsProvider,
)

Expand Down
6 changes: 3 additions & 3 deletions tests/test_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import sys
from typing import Iterator

import databricks # type:ignore
import pytest
from databricks import sql as databricks_sql
from harlequin.adapter import HarlequinAdapter, HarlequinConnection, HarlequinCursor
from harlequin.catalog import Catalog, CatalogItem
from harlequin.exception import HarlequinConnectionError, HarlequinQueryError
Expand All @@ -24,7 +24,7 @@ def test_plugin_discovery() -> None:
PLUGIN_NAME = "databricks"
eps = entry_points(group="harlequin.adapter")
assert eps[PLUGIN_NAME]
adapter_cls = eps[PLUGIN_NAME].load() # type:ignore
adapter_cls = eps[PLUGIN_NAME].load()
assert issubclass(adapter_cls, HarlequinAdapter)
assert adapter_cls == HarlequinDatabricksAdapter

Expand Down Expand Up @@ -125,5 +125,5 @@ def test_execute_raises_query_error(connection: HarlequinDatabricksConnection) -

def test_close(connection: HarlequinDatabricksConnection) -> None:
connection.close()
with pytest.raises(databricks.sql.exc.Error):
with pytest.raises(databricks_sql.exc.Error):
connection.conn.cursor() # cannot open a Cursor from a closed Databricks connection
Loading