From 3b916355b2535fc3012ed81460704dea70ae6213 Mon Sep 17 00:00:00 2001 From: pankajastro Date: Sat, 22 Nov 2025 22:58:45 +0530 Subject: [PATCH 1/6] Enable test for Python 3.13 --- .github/workflows/test.yml | 22 ++++++++++++++++++++-- pyproject.toml | 5 +++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2e36912b9e..2050391422 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,7 @@ name: test on: push: # Run on pushes to the default branch - branches: [main] + branches: [main, python3.13] # Also run on pull requests originating from forks. Although this is insecure by default, we need it to run # integration tests on forked PRs. As a guardrail, we’ve added an Authorize step to each job, which requires manually # approving the workflow run for each pushed commit. Approval only happens after a careful code review of the changes. @@ -54,7 +54,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] airflow-version: ["2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "3.0", "3.1"] dbt-version: ["1.10"] exclude: @@ -76,6 +76,24 @@ jobs: airflow-version: "2.7" - python-version: "3.12" airflow-version: "2.8" + - python-version: "3.13" + airflow-version: "2.4" + - python-version: "3.13" + airflow-version: "2.5" + - python-version: "3.13" + airflow-version: "2.6" + - python-version: "3.13" + airflow-version: "2.7" + - python-version: "3.13" + airflow-version: "2.8" + - python-version: "3.13" + airflow-version: "2.9" + - python-version: "3.13" + airflow-version: "2.10" + - python-version: "3.13" + airflow-version: "2.11" + - python-version: "3.13" + airflow-version: "3.0" steps: - uses: actions/checkout@v6.0.0 with: diff --git a/pyproject.toml b/pyproject.toml index a43ca252d2..7bf5a8da7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] dependencies = [ "aenum", @@ -167,7 +168,7 @@ dependencies = [ pre-install-commands = ["sh scripts/test/pre-install-airflow.sh {matrix:airflow} {matrix:python}"] [[tool.hatch.envs.tests.matrix]] -python = ["3.10", "3.11", "3.12"] +python = ["3.10", "3.11", "3.12", "3.13"] airflow = ["2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "3.0", "3.1"] dbt = ["1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "2.0"] @@ -227,7 +228,7 @@ serve = "sphinx-autobuild docs docs/_build" ###################################### [tool.black] line-length = 120 -target-version = ['py310', 'py311', 'py312'] +target-version = ["py310", "py311", "py312", "py213"] [tool.isort] profile = "black" From b1b6e722a4155ccb482d6333233755be403952b9 Mon Sep 17 00:00:00 2001 From: pankajastro Date: Sat, 22 Nov 2025 23:02:13 +0530 Subject: [PATCH 2/6] Enable test for Python 3.13 --- .github/workflows/test.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2050391422..d91a7fd3c0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -137,7 +137,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11"] + python-version: ["3.10", "3.11", "3.13"] airflow-version: ["2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "3.0", "3.1"] dbt-version: ["1.10"] exclude: @@ -145,6 +145,24 @@ jobs: airflow-version: "2.4" - python-version: "3.11" airflow-version: "2.5" + - python-version: "3.13" + airflow-version: "2.4" + - python-version: "3.13" + airflow-version: "2.5" + - python-version: "3.13" + airflow-version: "2.6" + - python-version: "3.13" + airflow-version: "2.7" + - python-version: "3.13" + airflow-version: "2.8" + - python-version: "3.13" + airflow-version: "2.9" + - python-version: "3.13" + airflow-version: "2.10" + - python-version: "3.13" + airflow-version: "2.11" + - python-version: "3.13" + airflow-version: "3.0" services: postgres: image: postgres@sha256:4cd697181d4bd3ddc41a09012f339fa8cb5a8cd3d8b30130ea8378c176b6c494 # 14.18 From c1a1d07cdce837db5df9017cea728d4f95da5e0a Mon Sep 17 00:00:00 2001 From: pankajastro Date: Sat, 22 Nov 2025 23:05:03 +0530 Subject: [PATCH 3/6] Enable test for Python 3.13 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7bf5a8da7e..d060acf77d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -228,7 +228,7 @@ serve = "sphinx-autobuild docs docs/_build" ###################################### [tool.black] line-length = 120 -target-version = ["py310", "py311", "py312", "py213"] +target-version = ["py310", "py311", "py312", "py313"] [tool.isort] profile = "black" From 67941bdf0a5c3bd6682cccbcde67e1efef348a8d Mon Sep 17 00:00:00 2001 From: pankajastro Date: Sat, 22 Nov 2025 23:11:18 +0530 Subject: [PATCH 4/6] Fix tests --- tests/operators/test_base.py | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/tests/operators/test_base.py b/tests/operators/test_base.py index 7394a7df95..400a97a06b 100644 --- a/tests/operators/test_base.py +++ b/tests/operators/test_base.py @@ -20,29 +20,17 @@ ) -@pytest.mark.skipif( - (sys.version_info.major, sys.version_info.minor) == (3, 12), - reason="The error message for the abstract class instantiation seems to have changed between Python 3.11 and 3.12", -) def test_dbt_base_is_abstract(): - """Tests that the abstract base operator cannot be instantiated since the base_cmd is not defined.""" - expected_error = ( - "Can't instantiate abstract class AbstractDbtBase with abstract methods base_cmd, build_and_run_cmd" - ) - with pytest.raises(TypeError, match=expected_error): - AbstractDbtBase(project_dir="project_dir") + if sys.version_info >= (3, 12): + expected_error = ( + "Can't instantiate abstract class AbstractDbtBase without an implementation for abstract methods " + "'base_cmd', 'build_and_run_cmd'" + ) + else: + expected_error = ( + "Can't instantiate abstract class AbstractDbtBase with abstract methods base_cmd, build_and_run_cmd" + ) - -@pytest.mark.skipif( - (sys.version_info.major, sys.version_info.minor) != (3, 12), - reason="The error message for the abstract class instantiation seems to have changed between Python 3.11 and 3.12", -) -def test_dbt_base_operator_is_abstract_py12(): - """Tests that the abstract base operator cannot be instantiated since the base_cmd is not defined.""" - expected_error = ( - "Can't instantiate abstract class AbstractDbtBase without an implementation for abstract methods " - "'base_cmd', 'build_and_run_cmd'" - ) with pytest.raises(TypeError, match=expected_error): AbstractDbtBase(project_dir="project_dir") From cb0538627edcf39a3b38c9024c6a2161297dcd71 Mon Sep 17 00:00:00 2001 From: Pankaj Singh <98807258+pankajastro@users.noreply.github.com> Date: Sat, 22 Nov 2025 23:38:01 +0530 Subject: [PATCH 5/6] Update .github/workflows/test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d91a7fd3c0..2912be45e5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,7 @@ name: test on: push: # Run on pushes to the default branch - branches: [main, python3.13] + branches: [main] # Also run on pull requests originating from forks. Although this is insecure by default, we need it to run # integration tests on forked PRs. As a guardrail, we’ve added an Authorize step to each job, which requires manually # approving the workflow run for each pushed commit. Approval only happens after a careful code review of the changes. From 649a03f1af9d7e57a358707ad8850ed6c55832d4 Mon Sep 17 00:00:00 2001 From: pankajastro Date: Sat, 22 Nov 2025 23:45:57 +0530 Subject: [PATCH 6/6] Add comments --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2912be45e5..626f5060ed 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -76,6 +76,7 @@ jobs: airflow-version: "2.7" - python-version: "3.12" airflow-version: "2.8" + # Apache Airflow versions prior to 3.1.0 have not been tested with Python 3.13. - python-version: "3.13" airflow-version: "2.4" - python-version: "3.13" @@ -145,6 +146,7 @@ jobs: airflow-version: "2.4" - python-version: "3.11" airflow-version: "2.5" + # Apache Airflow versions prior to 3.1.0 have not been tested with Python 3.13. - python-version: "3.13" airflow-version: "2.4" - python-version: "3.13"