-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add_release_internal_workflow
- Loading branch information
Showing
9 changed files
with
102 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Fixes | ||
body: Acknowledge `send_anonymous_usage_stats` setting for python models | ||
time: 2024-03-18T20:36:35.396323-04:00 | ||
custom: | ||
Author: mikealfare | ||
Issue: "830" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Fixes | ||
body: remove `private_key_path` from connection keys | ||
time: 2024-03-22T10:45:53.598328-05:00 | ||
custom: | ||
Author: McKnight-42 | ||
Issue: "949" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Under the Hood | ||
body: Add unit test for transaction semantics. | ||
time: 2024-02-27T01:04:28.713433-08:00 | ||
custom: | ||
Author: versusfacit | ||
Issue: "912" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,5 @@ | |
as ( | ||
{{ sql }} | ||
) | ||
; | ||
|
||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from dbt.tests.util import run_dbt_and_capture | ||
import pytest | ||
|
||
|
||
ANONYMOUS_USAGE_MESSAGE = """ | ||
sys._xoptions['snowflake_partner_attribution'].append("dbtLabs_dbtPython") | ||
""".strip() | ||
|
||
|
||
MY_PYTHON_MODEL = """ | ||
import pandas | ||
def model(dbt, session): | ||
dbt.config(materialized='table') | ||
data = [[1,2]] * 10 | ||
return pandas.DataFrame(data, columns=['test', 'test2']) | ||
""" | ||
|
||
|
||
class AnonymousUsageStatsBase: | ||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return {"my_python_model.py": MY_PYTHON_MODEL} | ||
|
||
|
||
class TestAnonymousUsageStatsOn(AnonymousUsageStatsBase): | ||
@pytest.fixture(scope="class") | ||
def project_config_update(self): | ||
return {"flags": {"send_anonymous_usage_stats": True}} | ||
|
||
def test_stats_get_sent(self, project): | ||
_, logs = run_dbt_and_capture(["--debug", "run"]) | ||
assert ANONYMOUS_USAGE_MESSAGE in logs | ||
|
||
|
||
class TestAnonymousUsageStatsOff(AnonymousUsageStatsBase): | ||
@pytest.fixture(scope="class") | ||
def project_config_update(self, dbt_profile_target): | ||
return {"flags": {"send_anonymous_usage_stats": False}} | ||
|
||
def test_stats_do_not_get_sent(self, project): | ||
_, logs = run_dbt_and_capture(["--debug", "run"]) | ||
assert ANONYMOUS_USAGE_MESSAGE not in logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from dbt.adapters.snowflake.relation import SnowflakeRelation | ||
from dbt.adapters.snowflake.relation_configs import SnowflakeRelationType | ||
|
||
|
||
def test_renameable_relation(): | ||
relation = SnowflakeRelation.create( | ||
database="my_db", | ||
schema="my_schema", | ||
identifier="my_table", | ||
type=SnowflakeRelationType.Table, | ||
) | ||
assert relation.renameable_relations == frozenset( | ||
{ | ||
SnowflakeRelationType.Table, | ||
SnowflakeRelationType.View, | ||
} | ||
) |