Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Fix constraints enforcement rollover test #1041

Merged
merged 5 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 6 additions & 10 deletions test.env.example
Original file line number Diff line number Diff line change
@@ -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=<personal token>
DBT_DATABRICKS_CLUSTER_NAME=<sql/protocolv1/o/{not this}/{this value}>
ODBC_DRIVER=</file/path/to/local/ODBC.driver>
DBT_DATABRICKS_ENDPOINT=</sql/1.0/warehouses/{this value}>

# users for testing 'grants' functionality
DBT_TEST_USER_1=
Expand Down
13 changes: 1 addition & 12 deletions tests/functional/adapter/test_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
mikealfare marked this conversation as resolved.
Show resolved Hide resolved
]

def assert_expected_error_messages(self, error_message, expected_error_messages):
Expand Down Expand Up @@ -358,17 +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
):
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
Expand Down
Loading