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
1 change: 0 additions & 1 deletion .github/workflows/docs_drift_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ on:
- 'examples/**'
- '**/*.md'
- 'pyproject.toml'
- 'dev_requirements.txt'
- '.github/workflows/docs_drift_check.yml'
workflow_dispatch:
inputs:
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ jobs:
with:
python-version: 3.12

- name: Upgrade Setuptools
run: pip install --upgrade setuptools wheel

- name: Install requirements
run: |
pip install -r dev_requirements.txt
pip install .
pip install --upgrade pip
pip install . --group dev

- name: Run lint
run: make lint
4 changes: 3 additions & 1 deletion .github/workflows/steps_local_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ jobs:
python-version: ${{ inputs.python-version }}

- name: Install requirements
run: pip3 install . -r dev_requirements.txt
run: |
pip3 install --upgrade pip
pip3 install . --group dev

- name: Run HTTP tests
env:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test_cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ jobs:
python-version: '3.11'

- name: Install requirements
run: pip3 install . -r dev_requirements.txt
run: |
pip3 install --upgrade pip
pip3 install . --group dev

- name: Run HTTP tests
env:
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,7 @@ dbt-tut
dev/
.python-version
*_project/
.user.yml
.user.yml

# uv
uv.lock
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### Unreleased

#### Improvements
* `dbt-core` is now capped at `<2.0`, and `dbt-common` and `agate` are declared as direct dependencies, matching dbt-labs adapters ([#776](https://github.com/ClickHouse/dbt-clickhouse/pull/776)).

#### Repository maintenance
* The shard-local table name of distributed materializations is now resolved in one place, `clickhouse_local_relation`, instead of being rebuilt inline in each materialization and incremental strategy ([#753](https://github.com/ClickHouse/dbt-clickhouse/pull/753)).

Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ Start by forking the repository on GitHub. This will create a copy of the reposi

* Make sure Python is installed locally, please refer to [dbt's python compatibility](https://docs.getdbt.com/faqs/Core/install-python-compatibility) (We recommend using version 3.12+).
* Create a dedicated virtual environment (optional but recommended)
* Install all the development requirements and the local project as an editable package:
* Install the local project as an editable package with the `dev` dependency group from `pyproject.toml`:

```bash
pip install -e . -r dev_requirements.txt
Comment thread
canbekley marked this conversation as resolved.
Resolved
# using pip 25.1+:
pip install -e . --group dev
```

* Verify the package was installed successfully:
Expand Down
6 changes: 3 additions & 3 deletions dbt/adapters/clickhouse/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from contextlib import contextmanager
from typing import TYPE_CHECKING, Any, Optional, Tuple, Union

import dbt.exceptions
from dbt.adapters.clickhouse.dbclient import ChRetryableException, get_db_client
from dbt.adapters.clickhouse.logger import logger
from dbt.adapters.contracts.connection import AdapterResponse, Connection
from dbt.adapters.sql import SQLConnectionManager
from dbt_common.exceptions import DbtRuntimeError

if TYPE_CHECKING:
import agate
Expand All @@ -30,9 +30,9 @@ def exception_handler(self, sql):
yield
except Exception as exp:
logger.debug('Error running SQL: {}', sql)
if isinstance(exp, dbt.exceptions.DbtRuntimeError):
if isinstance(exp, DbtRuntimeError):
raise
raise dbt.exceptions.DbtRuntimeError('ClickHouse exception: ' + str(exp)) from exp
raise DbtRuntimeError('ClickHouse exception: ' + str(exp)) from exp

@classmethod
def open(cls, connection):
Expand Down
12 changes: 0 additions & 12 deletions dev_requirements.txt

This file was deleted.

19 changes: 18 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ classifiers = [
]
requires-python = ">=3.10"
dependencies = [
"dbt-core>=1.9",
"dbt-adapters>=1.22.0,<1.25.0", # This version should be dbt-adapters<2.0, but keeping it fixed for now to avoid unexpected issues. We need to frequently update it.
# installed via dbt-adapters but used directly
"dbt-common>=1.36,<2.0",
"agate>=1.0,<2.0",
# add dbt-core to ensure backwards compatibility of installation, this is not a functional dependency
"dbt-core>=1.9,<2.0",
"clickhouse-connect>=0.10.0",
"clickhouse-driver>=0.2.10"
]
Expand All @@ -38,6 +42,19 @@ Documentation = "https://github.com/ClickHouse/dbt-clickhouse#documentation"
Changelog = "https://github.com/ClickHouse/dbt-clickhouse/blob/main/CHANGELOG.md"
Slack = "https://clickhouse.com/slack"

[dependency-groups]
dev = [
"dbt-core==1.12.*",
"dbt-tests-adapter>=1.10,<2.0",
"pytest>=7.2.0",
"pytest-dotenv==0.5.2",
"pytest-timeout==2.4.0",
"ruff==0.16.0",
"mypy==1.19.1",
"yamllint==1.37.1",
"requests~=2.34.2",
]

[tool.setuptools]
packages = {find = {include = ["dbt", "dbt.*"], namespaces = true}}

Expand Down
Loading