Skip to content

Commit

Permalink
check that saas mode is indeed set
Browse files Browse the repository at this point in the history
  • Loading branch information
guenp committed Sep 26, 2024
1 parent 86aeece commit 273b308
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
)
from dbt.artifacts.schemas.results import RunStatus

from dbt.adapters.duckdb.environments.motherduck import MOTHERDUCK_SAAS_MODE_QUERY

random_logs_sql = """
{{ config(materialized='table', meta=dict(temp_schema_name='dbt_temp_test')) }}
Expand Down Expand Up @@ -98,6 +100,8 @@ def run_dbt_scope(self, project, database_name):
project.run_sql(f"DROP TABLE {database_name}.plugin_table")

def test_motherduck(self, project):
(motherduck_saas_mode,) = project.run_sql(MOTHERDUCK_SAAS_MODE_QUERY, fetch="one")
assert motherduck_saas_mode == "1"
result = run_dbt(expect_pass=False)
expected_msg = "Python models are disabled when MotherDuck SaaS Mode is on."
assert [_res for _res in result.results if _res.status != RunStatus.Success][0].message == expected_msg
Expand Down

0 comments on commit 273b308

Please sign in to comment.