From 6c540b3de648c17dce7d5237b3014328009f0137 Mon Sep 17 00:00:00 2001 From: Mila Page Date: Tue, 25 Jun 2024 00:10:14 -0700 Subject: [PATCH 1/3] Add test. --- pyproject.toml | 6 +++--- .../adapter/dbt_show/test_dbt_show.py | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 tests/functional/adapter/dbt_show/test_dbt_show.py diff --git a/pyproject.toml b/pyproject.toml index 92fbf82a..3ff31537 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ path = "dbt/adapters/postgres/__version__.py" [tool.hatch.envs.default] dependencies = [ - "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git", + "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git@ADAP-207/get_show_sql_has_no_wrapping", "dbt-common @ git+https://github.com/dbt-labs/dbt-common.git", 'pre-commit==3.7.0;python_version>="3.9"', 'pre-commit==3.5.0;python_version=="3.8"', @@ -71,7 +71,7 @@ docker-prod = "docker build -f docker/Dockerfile -t dbt-postgres ." [tool.hatch.envs.unit-tests] dependencies = [ - "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git", + "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git@ADAP-207/get_show_sql_has_no_wrapping", "dbt-common @ git+https://github.com/dbt-labs/dbt-common.git", "dbt-core @ git+https://github.com/dbt-labs/dbt-core.git#subdirectory=core", "freezegun", @@ -86,7 +86,7 @@ all = "python -m pytest {args:tests/unit}" [tool.hatch.envs.integration-tests] template = "unit-tests" extra-dependencies = [ - "dbt-tests-adapter @ git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter", + "dbt-tests-adapter @ git+https://github.com/dbt-labs/dbt-adapters.git@ADAP-207/get_show_sql_has_no_wrapping", ] [tool.hatch.envs.integration-tests.env-vars] DBT_TEST_USER_1 = "dbt_test_user_1" diff --git a/tests/functional/adapter/dbt_show/test_dbt_show.py b/tests/functional/adapter/dbt_show/test_dbt_show.py new file mode 100644 index 00000000..b87000d4 --- /dev/null +++ b/tests/functional/adapter/dbt_show/test_dbt_show.py @@ -0,0 +1,17 @@ +from dbt.tests.adapter.dbt_show.test_dbt_show import ( + BaseShowSqlHeader, + BaseShowLimit, + BaseShowDoesNotHandleDoubleLimit, +) + + +class TestPostgresShowSqlHeader(BaseShowSqlHeader): + pass + + +class TestPostgresShowLimit(BaseShowLimit): + pass + + +class TestPostgresShowDoesNotHandleDoubleLimit(BaseShowDoesNotHandleDoubleLimit): + pass From a07676189e45eabb9ee0aa91b77c3cdbb90ca9d1 Mon Sep 17 00:00:00 2001 From: Mila Page Date: Fri, 28 Jun 2024 00:02:05 -0700 Subject: [PATCH 2/3] Set metadata to get tests passing. --- pyproject.toml | 11 +++++++++-- .../adapter/dbt_show/test_dbt_show.py | 17 ----------------- tests/functional/shared_tests/test_show.py | 5 +++++ 3 files changed, 14 insertions(+), 19 deletions(-) delete mode 100644 tests/functional/adapter/dbt_show/test_dbt_show.py diff --git a/pyproject.toml b/pyproject.toml index 3ff31537..f4c9bda1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,9 +22,14 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", ] + +[tool.hatch.metadata] +allow-direct-references = true + + dependencies = [ "psycopg2-binary>=2.9,<3.0", - "dbt-adapters>=0.1.0a1,<2.0", + "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git@ADAP-207/get_show_sql_has_no_wrapping", # add dbt-core to ensure backwards compatibility of installation, this is not a functional dependency "dbt-core>=1.8.0a1", # installed via dbt-adapters but used directly @@ -54,6 +59,7 @@ path = "dbt/adapters/postgres/__version__.py" [tool.hatch.envs.default] dependencies = [ + "psycopg2-binary>=2.9,<3.0", "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git@ADAP-207/get_show_sql_has_no_wrapping", "dbt-common @ git+https://github.com/dbt-labs/dbt-common.git", 'pre-commit==3.7.0;python_version>="3.9"', @@ -71,6 +77,7 @@ docker-prod = "docker build -f docker/Dockerfile -t dbt-postgres ." [tool.hatch.envs.unit-tests] dependencies = [ + "psycopg2-binary>=2.9,<3.0", "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git@ADAP-207/get_show_sql_has_no_wrapping", "dbt-common @ git+https://github.com/dbt-labs/dbt-common.git", "dbt-core @ git+https://github.com/dbt-labs/dbt-core.git#subdirectory=core", @@ -86,7 +93,7 @@ all = "python -m pytest {args:tests/unit}" [tool.hatch.envs.integration-tests] template = "unit-tests" extra-dependencies = [ - "dbt-tests-adapter @ git+https://github.com/dbt-labs/dbt-adapters.git@ADAP-207/get_show_sql_has_no_wrapping", + "dbt-tests-adapter @ git+https://github.com/dbt-labs/dbt-adapters.git@ADAP-207/get_show_sql_has_no_wrapping#subdirectory=dbt-tests-adapter", ] [tool.hatch.envs.integration-tests.env-vars] DBT_TEST_USER_1 = "dbt_test_user_1" diff --git a/tests/functional/adapter/dbt_show/test_dbt_show.py b/tests/functional/adapter/dbt_show/test_dbt_show.py deleted file mode 100644 index b87000d4..00000000 --- a/tests/functional/adapter/dbt_show/test_dbt_show.py +++ /dev/null @@ -1,17 +0,0 @@ -from dbt.tests.adapter.dbt_show.test_dbt_show import ( - BaseShowSqlHeader, - BaseShowLimit, - BaseShowDoesNotHandleDoubleLimit, -) - - -class TestPostgresShowSqlHeader(BaseShowSqlHeader): - pass - - -class TestPostgresShowLimit(BaseShowLimit): - pass - - -class TestPostgresShowDoesNotHandleDoubleLimit(BaseShowDoesNotHandleDoubleLimit): - pass diff --git a/tests/functional/shared_tests/test_show.py b/tests/functional/shared_tests/test_show.py index 47974a04..7f3da925 100644 --- a/tests/functional/shared_tests/test_show.py +++ b/tests/functional/shared_tests/test_show.py @@ -1,6 +1,7 @@ from dbt.tests.adapter.dbt_show.test_dbt_show import ( BaseShowLimit, BaseShowSqlHeader, + BaseShowDoesNotHandleDoubleLimit, ) @@ -10,3 +11,7 @@ class TestPostgresShowSqlHeader(BaseShowSqlHeader): class TestPostgresShowLimit(BaseShowLimit): pass + + +class TestPostgresShowDoesNotHandleDoubleLimit(BaseShowDoesNotHandleDoubleLimit): + pass From d935bc17e16cf344a65fe3c697350fab62c31e0e Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 3 Jul 2024 13:54:57 -0400 Subject: [PATCH 3/3] point dev branches back to main --- pyproject.toml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f4c9bda1..92fbf82a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,14 +22,9 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", ] - -[tool.hatch.metadata] -allow-direct-references = true - - dependencies = [ "psycopg2-binary>=2.9,<3.0", - "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git@ADAP-207/get_show_sql_has_no_wrapping", + "dbt-adapters>=0.1.0a1,<2.0", # add dbt-core to ensure backwards compatibility of installation, this is not a functional dependency "dbt-core>=1.8.0a1", # installed via dbt-adapters but used directly @@ -59,8 +54,7 @@ path = "dbt/adapters/postgres/__version__.py" [tool.hatch.envs.default] dependencies = [ - "psycopg2-binary>=2.9,<3.0", - "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git@ADAP-207/get_show_sql_has_no_wrapping", + "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git", "dbt-common @ git+https://github.com/dbt-labs/dbt-common.git", 'pre-commit==3.7.0;python_version>="3.9"', 'pre-commit==3.5.0;python_version=="3.8"', @@ -77,8 +71,7 @@ docker-prod = "docker build -f docker/Dockerfile -t dbt-postgres ." [tool.hatch.envs.unit-tests] dependencies = [ - "psycopg2-binary>=2.9,<3.0", - "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git@ADAP-207/get_show_sql_has_no_wrapping", + "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git", "dbt-common @ git+https://github.com/dbt-labs/dbt-common.git", "dbt-core @ git+https://github.com/dbt-labs/dbt-core.git#subdirectory=core", "freezegun", @@ -93,7 +86,7 @@ all = "python -m pytest {args:tests/unit}" [tool.hatch.envs.integration-tests] template = "unit-tests" extra-dependencies = [ - "dbt-tests-adapter @ git+https://github.com/dbt-labs/dbt-adapters.git@ADAP-207/get_show_sql_has_no_wrapping#subdirectory=dbt-tests-adapter", + "dbt-tests-adapter @ git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter", ] [tool.hatch.envs.integration-tests.env-vars] DBT_TEST_USER_1 = "dbt_test_user_1"