From aa6e09bd4e15d65650abc5d921f040f493ff98aa Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 8 May 2024 15:54:22 -0400 Subject: [PATCH 1/5] unskip offending test case --- tests/functional/adapter/test_constraints.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/functional/adapter/test_constraints.py b/tests/functional/adapter/test_constraints.py index 654bbdb5f..666e8cb7b 100644 --- a/tests/functional/adapter/test_constraints.py +++ b/tests/functional/adapter/test_constraints.py @@ -358,10 +358,6 @@ def models(self): "constraints_schema.yml": constraints_yml, } - @pytest.mark.skip( - "Databricks now raises an exception, which gets raised prior to the `expected_pass` check." - "See https://github.com/dbt-labs/dbt-spark/issues/1009" - ) def test__constraints_enforcement_rollback( self, project, expected_color, expected_error_messages, null_model_sql ): From d961b2bd18990efe39ab14763385e64612635ea7 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 8 May 2024 19:01:45 -0400 Subject: [PATCH 2/5] update help in example test env file --- test.env.example | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/test.env.example b/test.env.example index e69f700b7..140da4042 100644 --- a/test.env.example +++ b/test.env.example @@ -1,13 +1,9 @@ -# Cluster ID -DBT_DATABRICKS_CLUSTER_NAME= -# SQL Endpoint -DBT_DATABRICKS_ENDPOINT= -# Server Hostname value -DBT_DATABRICKS_HOST_NAME= -# personal token -DBT_DATABRICKS_TOKEN= -# file path to local ODBC driver -ODBC_DRIVER= +# databricks credentials +DBT_DATABRICKS_HOST_NAME=<{this value}.cloud.databricks.com>.cloud.databricks.com +DBT_DATABRICKS_TOKEN= +DBT_DATABRICKS_CLUSTER_NAME= +ODBC_DRIVER= +DBT_DATABRICKS_ENDPOINT= # users for testing 'grants' functionality DBT_TEST_USER_1= From 40ac15848c4aa81c0e8813f334603aed518c00e4 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 8 May 2024 19:02:16 -0400 Subject: [PATCH 3/5] install pyodbc from source to support arm machines --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 18ccc77fd..40335fb8a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ pyhive[hive_pure_sasl]~=0.7.0 requests>=2.28.1 -pyodbc~=5.0.1 +pyodbc~=5.0.1 --no-binary pyodbc sqlparams>=3.0.0 thrift>=0.13.0 sqlparse>=0.4.2 # not directly required, pinned by Snyk to avoid a vulnerability From 472d0270824fd7d7c93d66a6da56f3cbf1d64149 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 8 May 2024 19:03:00 -0400 Subject: [PATCH 4/5] unskip offending test --- tests/functional/adapter/test_constraints.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/functional/adapter/test_constraints.py b/tests/functional/adapter/test_constraints.py index 666e8cb7b..41b50ef81 100644 --- a/tests/functional/adapter/test_constraints.py +++ b/tests/functional/adapter/test_constraints.py @@ -358,13 +358,6 @@ def models(self): "constraints_schema.yml": constraints_yml, } - def test__constraints_enforcement_rollback( - self, project, expected_color, expected_error_messages, null_model_sql - ): - super().test__constraints_enforcement_rollback( - project, expected_color, expected_error_messages, null_model_sql - ) - # TODO: Like the tests above, this does test that model-level constraints don't # result in errors, but it does not verify that they are actually present in From 01bf12506239625cdddaeb27c2e9a8347deb651d Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 8 May 2024 20:38:47 -0400 Subject: [PATCH 5/5] allow for both col and column --- tests/functional/adapter/test_constraints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/adapter/test_constraints.py b/tests/functional/adapter/test_constraints.py index 41b50ef81..e35a13a64 100644 --- a/tests/functional/adapter/test_constraints.py +++ b/tests/functional/adapter/test_constraints.py @@ -316,7 +316,7 @@ def expected_error_messages(self): "violate the new NOT NULL constraint", "(id > 0) violated by row with values:", # incremental mats "DELTA_VIOLATE_CONSTRAINT_WITH_VALUES", # incremental mats - "NOT NULL constraint violated for column", + "NOT NULL constraint violated for col", ] def assert_expected_error_messages(self, error_message, expected_error_messages):