Skip to content

Commit

Permalink
Python_models test reformat (#337)
Browse files Browse the repository at this point in the history
* setting use_anonymous_sproc to True by default

* add changelog

* changing python models test to take into account to default swap for anon_sproc

* add changelog entry

* adding a check against stored procedures to test non default

Co-authored-by: Chenyu Li <chenyulee777@gmail.com>
  • Loading branch information
McKnight-42 and ChenyuLInx authored Dec 5, 2022
1 parent 505be6a commit df24397
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .changes/unreleased/Under the Hood-20221202-010112.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
kind: Under the Hood
body: changing python_model test configs to take into account swap for anonymous_sproc
as new default
time: 2022-12-02T01:01:12.129993-06:00
custom:
Author: McKnight-42
Issue: "305"
PR: "337"
11 changes: 3 additions & 8 deletions tests/functional/adapter/test_python_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
from dbt.tests.adapter.python_model.test_python_model import BasePythonModelTests, BasePythonIncrementalTests

class TestPythonModelSnowflake(BasePythonModelTests):
@pytest.fixture(scope="class")
def project_config_update(self):
return {
"models":{ "use_anonymous_sproc": True}
}
pass

class TestIncrementalSnowflake(BasePythonIncrementalTests):
pass
Expand Down Expand Up @@ -51,11 +47,11 @@ def test_changing_schema(self,project):
from snowflake.snowpark.types import StructType, FloatType, StringType, StructField
def model( dbt, session):
dbt.config(
materialized='table',
imports = ['@dbt_integration_test/iris.csv'],
use_anonymous_sproc = True
use_anonymous_sproc = False
)
schema_for_data_file = StructType([
StructField("length1", FloatType()),
Expand Down Expand Up @@ -83,4 +79,3 @@ def test_import(self,project):
project.run_sql("create or replace STAGE dbt_integration_test")
project.run_sql(f"PUT file://{project.project_root}/seeds/iris.csv @dbt_integration_test/;")
run_dbt(["run"])

0 comments on commit df24397

Please sign in to comment.