Skip to content

Commit 80f2fcf

Browse files
fix: [SNOW-1890085] rename sql object DBT -> DBT PROJECT
1 parent 1933dbb commit 80f2fcf

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/snowflake/cli/_plugins/dbt/manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def execute_query(self, query, **kwargs):
3939

4040
class DBTManager(StdoutExecutionMixin):
4141
def list(self) -> SnowflakeCursor: # noqa: A003
42-
query = "SHOW DBT"
42+
query = "SHOW DBT PROJECT"
4343
return self.execute_query(query)
4444

4545
def deploy(self, path: Path, name: FQN, force: bool) -> SnowflakeCursor:
@@ -58,11 +58,11 @@ def deploy(self, path: Path, name: FQN, force: bool) -> SnowflakeCursor:
5858
cli_console.step(f"Copied {len(results)} files")
5959

6060
with cli_console.phase("Creating DBT project"):
61-
query = f"CREATE OR REPLACE DBT {name} FROM {stage_name}"
61+
query = f"CREATE OR REPLACE DBT PROJECT {name} FROM {stage_name}"
6262
return self.execute_query(query)
6363

6464
def execute(self, dbt_command: str, name: str, *dbt_cli_args):
65-
query = f"EXECUTE DBT {name} {dbt_command}"
65+
query = f"EXECUTE DBT PROJECT {name} {dbt_command}"
6666
if dbt_cli_args:
6767
query += " " + " ".join([arg for arg in dbt_cli_args])
6868
return self.execute_query(query)

tests/dbt/test_dbt_commands.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_dbt_list(self, mock_connect, runner):
3535
result = runner.invoke(["dbt", "list"])
3636

3737
assert result.exit_code == 0, result.output
38-
assert mock_connect.mocked_ctx.get_query() == "SHOW DBT"
38+
assert mock_connect.mocked_ctx.get_query() == "SHOW DBT PROJECT"
3939

4040

4141
class TestDBTDeploy:
@@ -64,7 +64,7 @@ def test_deploys_project_from_source(
6464
assert result.exit_code == 0, result.output
6565
assert (
6666
mock_connect.mocked_ctx.get_query()
67-
== "CREATE OR REPLACE DBT TEST_PIPELINE FROM @MockDatabase.MockSchema.dbt_TEST_PIPELINE_stage"
67+
== "CREATE OR REPLACE DBT PROJECT TEST_PIPELINE FROM @MockDatabase.MockSchema.dbt_TEST_PIPELINE_stage"
6868
)
6969
stage_fqn = FQN.from_string(f"dbt_TEST_PIPELINE_stage").using_context()
7070
mock_create.assert_called_once_with(stage_fqn, temporary=True)
@@ -98,7 +98,7 @@ class TestDBTExecute:
9898
"pipeline_name",
9999
"test",
100100
],
101-
"EXECUTE DBT pipeline_name test",
101+
"EXECUTE DBT PROJECT pipeline_name test",
102102
id="simple-command",
103103
),
104104
pytest.param(
@@ -110,12 +110,12 @@ class TestDBTExecute:
110110
"-f",
111111
"--select @source:snowplow,tag:nightly models/export",
112112
],
113-
"EXECUTE DBT pipeline_name run -f --select @source:snowplow,tag:nightly models/export",
113+
"EXECUTE DBT PROJECT pipeline_name run -f --select @source:snowplow,tag:nightly models/export",
114114
id="with-dbt-options",
115115
),
116116
pytest.param(
117117
["dbt", "execute", "pipeline_name", "compile", "--vars '{foo:bar}'"],
118-
"EXECUTE DBT pipeline_name compile --vars '{foo:bar}'",
118+
"EXECUTE DBT PROJECT pipeline_name compile --vars '{foo:bar}'",
119119
id="with-dbt-vars",
120120
),
121121
pytest.param(
@@ -131,7 +131,7 @@ class TestDBTExecute:
131131
"--info",
132132
"--config-file=/",
133133
],
134-
"EXECUTE DBT pipeline_name compile --format=TXT -v -h --debug --info --config-file=/",
134+
"EXECUTE DBT PROJECT pipeline_name compile --format=TXT -v -h --debug --info --config-file=/",
135135
id="with-dbt-conflicting-options",
136136
),
137137
pytest.param(
@@ -142,7 +142,7 @@ class TestDBTExecute:
142142
"pipeline_name",
143143
"compile",
144144
],
145-
"EXECUTE DBT pipeline_name compile",
145+
"EXECUTE DBT PROJECT pipeline_name compile",
146146
id="with-cli-flag",
147147
),
148148
],

0 commit comments

Comments
 (0)