From 3ff70d8f78e314e6a3a5c845e86cc359f01df732 Mon Sep 17 00:00:00 2001 From: Pankaj Singh <98807258+pankajastro@users.noreply.github.com> Date: Sat, 7 Dec 2024 01:45:28 +0530 Subject: [PATCH] Enable kubernetes tests for dbt>=1.8 (#1364) closes: https://github.com/astronomer/astronomer-cosmos/issues/1344 This PR is doing below modification - Upgrade Python version to Python3.12 - Add `--force-reinstall` flag in pip install command - Install dbt-command separately based on suggestion: https://github.com/dbt-labs/dbt-core/issues/10135#issuecomment-2116226848 Success CI job: https://github.com/astronomer/astronomer-cosmos/actions/runs/12165978965/job/33931200107?pr=1364 --- .github/workflows/test.yml | 2 +- dev/Dockerfile.postgres_profile_docker_k8s | 5 +++-- scripts/test/kubernetes-setup.sh | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f9dbd2c4..a80a62d60 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -491,7 +491,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.11" ] + python-version: [ "3.12" ] airflow-version: [ "2.10" ] steps: - uses: actions/checkout@v3 diff --git a/dev/Dockerfile.postgres_profile_docker_k8s b/dev/Dockerfile.postgres_profile_docker_k8s index ae81a5b9f..a7f55795f 100644 --- a/dev/Dockerfile.postgres_profile_docker_k8s +++ b/dev/Dockerfile.postgres_profile_docker_k8s @@ -1,6 +1,7 @@ -FROM python:3.11 +FROM python:3.12 -RUN pip install dbt-postgres==1.8.2 psycopg2==2.9.3 pytz +RUN pip install --force-reinstall 'dbt-postgres>=1.8' +RUN pip install --force-reinstall dbt-adapters ENV POSTGRES_DATABASE=postgres ENV POSTGRES_DB=postgres diff --git a/scripts/test/kubernetes-setup.sh b/scripts/test/kubernetes-setup.sh index b08f37d1d..485bc3382 100644 --- a/scripts/test/kubernetes-setup.sh +++ b/scripts/test/kubernetes-setup.sh @@ -5,8 +5,8 @@ set -x set -e -# TODO: https://github.com/astronomer/astronomer-cosmos/issues/1344 -pip install 'dbt-postgres<1.8' 'psycopg2==2.9.3' 'pytz' +pip install --force-reinstall 'dbt-postgres>=1.8' +pip install --force-reinstall dbt-adapters # Create a Kubernetes secret named 'postgres-secrets' with the specified literals for host and password kubectl create secret generic postgres-secrets \