From 908ab2d658092e43443c25473b391adb59e56407 Mon Sep 17 00:00:00 2001 From: Geoff Genz Date: Mon, 1 Apr 2024 23:18:16 -0600 Subject: [PATCH 1/5] Release 1.7.5 housekeeping --- .github/workflows/lint.yml | 4 ++-- .github/workflows/pypi.yml | 2 +- .github/workflows/test_matrix.yml | 7 ++++--- CHANGELOG.md | 6 ++++++ dev_requirements.txt | 8 ++++---- pyproject.toml | 2 +- 6 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f5f9a9bc..5a703f17 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,10 +18,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Setup Python 3.9 + - name: Setup Python 3.11 uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: 3.11 - name: Upgrade Setuptools run: pip install --upgrade setuptools wheel diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 6e4fcc6d..e3ecdf59 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -21,7 +21,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.11" - name: Upgrade Setuptools run: pip install --upgrade setuptools wheel diff --git a/.github/workflows/test_matrix.yml b/.github/workflows/test_matrix.yml index 3da76748..fa9e48a2 100644 --- a/.github/workflows/test_matrix.yml +++ b/.github/workflows/test_matrix.yml @@ -26,11 +26,12 @@ jobs: - '3.9' - '3.10' - '3.11' + - '3.12' clickhouse-version: - - '23.3' - '23.8' - - '23.9' - - '23.10' + - '24.1' + - '24.2' + - '24.3' - latest steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f2e8961..02588474 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### Release [1.7.5], 2024-04-02 +#### Bug Fixes +- Requirements and tests upgraded to include Python 3.12. Closes https://github.com/ClickHouse/dbt-clickhouse/issues/264 +- Model settings were not working correctly for customer materializations. Thanks to original dbt-clickhouse [silentsokolov](https://github.com/silentsokolov) +for the PR! + ### Release [1.7.4], 2024-03-23 #### Improvement - Adds support for materializing ClickHouse dictionaries. Thanks to [Rory Sawyer](https://github.com/SoryRawyer) for the contribution! diff --git a/dev_requirements.txt b/dev_requirements.txt index 257cf72c..b81f8a92 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,9 +1,9 @@ -dbt-core~=1.7.3 -clickhouse-connect>=0.6.22 -clickhouse-driver>=0.2.6 +dbt-core~=1.7.11 +clickhouse-connect>=0.7.6 +clickhouse-driver>=0.2.7 pytest>=7.2.0 pytest-dotenv==0.5.2 -dbt-tests-adapter~=1.7.3 +dbt-tests-adapter~=1.7.11 black==24.3.0 isort==5.10.1 mypy==0.991 diff --git a/pyproject.toml b/pyproject.toml index 68570715..842526f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.black] line-length = 100 skip-string-normalization = true -target-version = ['py310', 'py311'] +target-version = ['py310', 'py311', 'py312'] exclude = '(\.eggs|\.git|\.mypy_cache|\.venv|venv|env|_build|build|build|dist|)' [tool.isort] From deabd1ce7982e4ec5d0d4ee22fd579b73e84f584 Mon Sep 17 00:00:00 2001 From: Geoff Genz Date: Tue, 2 Apr 2024 00:00:06 -0600 Subject: [PATCH 2/5] Upgrade setuptools requirement for clickhouse_driver install --- dbt/adapters/clickhouse/__version__.py | 2 +- dbt/adapters/clickhouse/dbclient.py | 8 ++++---- dev_requirements.txt | 4 ++-- setup.py | 1 + 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dbt/adapters/clickhouse/__version__.py b/dbt/adapters/clickhouse/__version__.py index 86d86eea..ee8593ed 100644 --- a/dbt/adapters/clickhouse/__version__.py +++ b/dbt/adapters/clickhouse/__version__.py @@ -1 +1 @@ -version = '1.7.4' +version = '1.7.5' diff --git a/dbt/adapters/clickhouse/dbclient.py b/dbt/adapters/clickhouse/dbclient.py index 31037f36..7bb78785 100644 --- a/dbt/adapters/clickhouse/dbclient.py +++ b/dbt/adapters/clickhouse/dbclient.py @@ -53,20 +53,20 @@ def get_db_client(credentials: ClickHouseCredentials): from dbt.adapters.clickhouse.nativeclient import ChNativeClient return ChNativeClient(credentials) - except ImportError: + except ImportError as ex: raise FailedToConnectError( 'Native adapter required but package clickhouse-driver is not installed' - ) + ) from ex try: import clickhouse_connect # noqa from dbt.adapters.clickhouse.httpclient import ChHttpClient return ChHttpClient(credentials) - except ImportError: + except ImportError as ex: raise FailedToConnectError( 'HTTP adapter required but package clickhouse-connect is not installed' - ) + ) from ex class ChRetryableException(Exception): diff --git a/dev_requirements.txt b/dev_requirements.txt index b81f8a92..cc3feb46 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -12,5 +12,5 @@ flake8==4.0.1 types-requests==2.27.29 agate~=1.7.1 requests~=2.27.1 -setuptools~=65.3.0 -types-setuptools==67.1.0.0 \ No newline at end of file +setuptools>=69.2.0 +types-setuptools>=69.2.0 \ No newline at end of file diff --git a/setup.py b/setup.py index 7beb9ba9..b5f27dbd 100644 --- a/setup.py +++ b/setup.py @@ -57,6 +57,7 @@ def _dbt_clickhouse_version(): f'dbt-core~={dbt_version}', 'clickhouse-connect>=0.6.22', 'clickhouse-driver>=0.2.6', + 'setuptools>=0.69' ], python_requires=">=3.8", platforms='any', From 081346831077461bc7ca353fa40dc06e4dee5a49 Mon Sep 17 00:00:00 2001 From: Geoff Genz Date: Tue, 2 Apr 2024 00:09:09 -0600 Subject: [PATCH 3/5] Remove flake8 checks for the moment --- Makefile | 8 ++------ dev_requirements.txt | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 1a0d7dfd..feb23310 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Check style and linting -.PHONY: check-black check-isort check-flake8 check-mypy lint +.PHONY: check-black check-isort check-mypy lint check-black: @echo "--> Running black checks" @@ -9,10 +9,6 @@ check-isort: @echo "--> Running isort checks" @isort --check-only . -check-flake8: - @echo "--> Running flake8 checks" - @flake8 . - check-mypy: @echo "--> Running mypy checks" @mypy --exclude dbt/adapters/clickhouse/__init__.py --exclude conftest.py . @@ -21,7 +17,7 @@ check-yamllint: @echo "--> Running yamllint checks" @yamllint dbt tests .github -lint: check-black check-isort check-flake8 check-mypy check-yamllint +lint: check-black check-isort check-mypy check-yamllint # Format code .PHONY: fmt diff --git a/dev_requirements.txt b/dev_requirements.txt index cc3feb46..9c72b0c5 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -8,7 +8,6 @@ black==24.3.0 isort==5.10.1 mypy==0.991 yamllint==1.26.3 -flake8==4.0.1 types-requests==2.27.29 agate~=1.7.1 requests~=2.27.1 From 59bd95ced093e46b1009176cc49e780029585806 Mon Sep 17 00:00:00 2001 From: Geoff Genz Date: Tue, 2 Apr 2024 00:14:13 -0600 Subject: [PATCH 4/5] Update workflow actions --- .github/workflows/lint.yml | 4 ++-- .github/workflows/pypi.yml | 4 ++-- .github/workflows/test_cloud.yml | 4 ++-- .github/workflows/test_matrix.yml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5a703f17..4286da28 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,10 +16,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Python 3.11 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index e3ecdf59..4a8915d6 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -16,10 +16,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" diff --git a/.github/workflows/test_cloud.yml b/.github/workflows/test_cloud.yml index d6403b1d..07d94bce 100644 --- a/.github/workflows/test_cloud.yml +++ b/.github/workflows/test_cloud.yml @@ -21,10 +21,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Python 3.11 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.11' diff --git a/.github/workflows/test_matrix.yml b/.github/workflows/test_matrix.yml index fa9e48a2..224d17d3 100644 --- a/.github/workflows/test_matrix.yml +++ b/.github/workflows/test_matrix.yml @@ -36,7 +36,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set environment variables if: ${{ matrix.clickhouse-version == '22.3' }} @@ -50,7 +50,7 @@ jobs: run: REPLICA_NUM=1 docker-compose -f ${{ github.workspace }}/tests/integration/docker-compose.yml up -d - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} From 6ed1c5dc386b8be97d8dc55dd4244e2ba9b3ade9 Mon Sep 17 00:00:00 2001 From: Geoff Genz Date: Tue, 2 Apr 2024 00:15:13 -0600 Subject: [PATCH 5/5] Fix black comma --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b5f27dbd..1958f8c5 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ def _dbt_clickhouse_version(): f'dbt-core~={dbt_version}', 'clickhouse-connect>=0.6.22', 'clickhouse-driver>=0.2.6', - 'setuptools>=0.69' + 'setuptools>=0.69', ], python_requires=">=3.8", platforms='any',