Skip to content

Commit 41d9e8a

Browse files
feat: [SNOW-2251139] Remove dbt feature flags (#2668)
1 parent ec2cc02 commit 41d9e8a

File tree

10 files changed

+47
-118
lines changed

10 files changed

+47
-118
lines changed

RELEASE-NOTES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,18 @@
2121
## New additions
2222
* Added global option `--decimal-precision` allowing setting arbitrary precision for Python's `Decimal` type.
2323
* Added support for `auto_suspend_secs` parameter in SPCS service commands (`deploy`, `set`, `unset`) to configure automatic service suspension after inactivity period.
24+
* Added `snow dbt describe` and `snow dbt drop` commands
25+
* Added `snow dbt execute ... retry` subcommand
26+
* Added new flags to `snow dbt deploy` command:
27+
* `--default-target` to set a default target
28+
* `--unset-default-target` to clear default
29+
* `--external-access-integration` sets external access integrations (needed to pull external deps on altering dbt project object)
30+
* `--install-local-deps` instructs to install dependencies located in the project
2431

2532
## Fixes and improvements
2633
* Bumped `snowflake-connector-python==3.18.0`
2734
* Grant privileges defined in `snowflake.yml` after deploying Streamlit
35+
* Relaxed dbt profiles.yml validation rules; added extra validation for role specified in profiles.yml
2836

2937

3038
# v3.12.0

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
from snowflake.cli.api.console.console import cli_console
3636
from snowflake.cli.api.constants import ObjectType
3737
from snowflake.cli.api.exceptions import CliError
38-
from snowflake.cli.api.feature_flags import FeatureFlag
3938
from snowflake.cli.api.identifiers import FQN
4039
from snowflake.cli.api.output.types import (
4140
CommandResult,
@@ -47,8 +46,6 @@
4746
app = SnowTyperFactory(
4847
name="dbt",
4948
help="Manages dbt on Snowflake projects.",
50-
is_hidden=FeatureFlag.ENABLE_DBT.is_disabled,
51-
preview=True,
5249
)
5350
log = logging.getLogger(__name__)
5451

@@ -105,25 +102,21 @@ def deploy_dbt(
105102
),
106103
default_target: Optional[str] = DefaultTargetOption(
107104
help="Default target for the dbt project. Mutually exclusive with --unset-default-target.",
108-
hidden=FeatureFlag.ENABLE_DBT_GA_FEATURES.is_disabled(),
109105
),
110106
unset_default_target: Optional[bool] = UnsetDefaultTargetOption(
111107
help="Unset the default target for the dbt project. Mutually exclusive with --default-target.",
112-
hidden=FeatureFlag.ENABLE_DBT_GA_FEATURES.is_disabled(),
113108
),
114109
external_access_integrations: Optional[list[str]] = typer.Option(
115110
None,
116111
"--external-access-integration",
117112
show_default=False,
118113
help="External access integration to be used by the dbt object.",
119-
hidden=FeatureFlag.ENABLE_DBT_GA_FEATURES.is_disabled(),
120114
),
121115
install_local_deps: Optional[bool] = typer.Option(
122116
False,
123117
"--install-local-deps",
124118
show_default=False,
125119
help="Installs local dependencies from project that don't require external access.",
126-
hidden=FeatureFlag.ENABLE_DBT_GA_FEATURES.is_disabled(),
127120
),
128121
**options,
129122
) -> CommandResult:
@@ -134,12 +127,6 @@ def deploy_dbt(
134127
snow dbt deploy PROJECT
135128
snow dbt deploy PROJECT --source=/Users/jdoe/project --force
136129
"""
137-
if FeatureFlag.ENABLE_DBT_GA_FEATURES.is_disabled():
138-
default_target = None
139-
unset_default_target = False
140-
external_access_integrations = None
141-
install_local_deps = False
142-
143130
project_path = SecurePath(source) if source is not None else SecurePath.cwd()
144131
profiles_dir_path = SecurePath(profiles_dir) if profiles_dir else project_path
145132
return QueryResult(
@@ -161,7 +148,6 @@ def deploy_dbt(
161148
help="Execute a dbt command on Snowflake. Subcommand name and all "
162149
"parameters following it will be passed over to dbt.",
163150
subcommand_metavar="DBT_COMMAND",
164-
preview=True,
165151
)
166152
app.add_typer(dbt_execute_app)
167153

@@ -188,7 +174,6 @@ def before_callback(
188174
context_settings={"allow_extra_args": True, "ignore_unknown_options": True},
189175
help=f"Execute {cmd} command on Snowflake. Command name and all parameters following it will be passed over to dbt.",
190176
add_help_option=False,
191-
preview=True,
192177
)
193178
def _dbt_execute(
194179
ctx: typer.Context,

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from snowflake.cli.api.console import cli_console
2727
from snowflake.cli.api.constants import DEFAULT_SIZE_LIMIT_MB, ObjectType
2828
from snowflake.cli.api.exceptions import CliError
29-
from snowflake.cli.api.feature_flags import FeatureFlag
3029
from snowflake.cli.api.identifiers import FQN
3130
from snowflake.cli.api.secure_path import SecurePath
3231
from snowflake.cli.api.sql_execution import SqlExecutionMixin
@@ -291,10 +290,6 @@ def _validate_target(
291290
"schema",
292291
"type",
293292
}
294-
if FeatureFlag.ENABLE_DBT_GA_FEATURES.is_disabled():
295-
required_fields.add("account")
296-
required_fields.add("user")
297-
required_fields.add("warehouse")
298293
if missing_keys := required_fields - set(target_details.keys()):
299294
errors.append(
300295
f"Missing required fields: {', '.join(sorted(missing_keys))} in target {target_name}"

src/snowflake/cli/api/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class PatternMatchingType(Enum):
8989
ObjectType.APPLICATION.value.cli_name,
9090
ObjectType.APPLICATION_PACKAGE.value.cli_name,
9191
ObjectType.DCM_PROJECT.value.cli_name,
92-
ObjectType.DBT_PROJECT.value.cli_name, # ENABLE_DBT_GA_FEATURES
92+
ObjectType.DBT_PROJECT.value.cli_name,
9393
}
9494
SUPPORTED_OBJECTS = sorted(OBJECT_TO_NAMES.keys() - UNSUPPORTED_OBJECTS)
9595

src/snowflake/cli/api/feature_flags.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ class FeatureFlag(FeatureFlagMixin):
6464
)
6565
ENABLE_SNOWPARK_GLOB_SUPPORT = BooleanFlag("ENABLE_SNOWPARK_GLOB_SUPPORT", False)
6666
ENABLE_SPCS_SERVICE_EVENTS = BooleanFlag("ENABLE_SPCS_SERVICE_EVENTS", False)
67-
ENABLE_DBT = BooleanFlag("ENABLE_DBT", False)
68-
ENABLE_DBT_GA_FEATURES = BooleanFlag("ENABLE_DBT_GA_FEATURES", False)
6967
ENABLE_NATIVE_APP_PYTHON_SETUP = BooleanFlag(
7068
"ENABLE_NATIVE_APP_PYTHON_SETUP", False
7169
)

tests/__snapshots__/test_help_messages.ambr

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
| auth Manages authentication methods. |
2525
| connection Manages connections to Snowflake. |
2626
| cortex Provides access to Snowflake Cortex. |
27+
| dbt Manages dbt on Snowflake projects. |
2728
| git Manages git repositories in Snowflake. |
2829
| helpers Helper commands. |
2930
| init Creates project directory from template. |
@@ -4591,17 +4592,37 @@
45914592
| [required] |
45924593
+------------------------------------------------------------------------------+
45934594
+- Options --------------------------------------------------------------------+
4594-
| --source TEXT Path to directory containing dbt |
4595-
| files to deploy. Defaults to current |
4596-
| working directory. |
4597-
| --profiles-dir TEXT Path to directory containing |
4598-
| profiles.yml. Defaults to directory |
4599-
| provided in --source or current |
4600-
| working directory |
4601-
| --force --no-force Overwrites conflicting files in the |
4602-
| project, if any. |
4603-
| [default: no-force] |
4604-
| --help -h Show this message and exit. |
4595+
| --source TEXT Path to directory |
4596+
| containing dbt files to |
4597+
| deploy. Defaults to |
4598+
| current working |
4599+
| directory. |
4600+
| --profiles-dir TEXT Path to directory |
4601+
| containing profiles.yml. |
4602+
| Defaults to directory |
4603+
| provided in --source or |
4604+
| current working directory |
4605+
| --force --no-force Overwrites conflicting |
4606+
| files in the project, if |
4607+
| any. |
4608+
| [default: no-force] |
4609+
| --default-target TEXT Default target for the |
4610+
| dbt project. Mutually |
4611+
| exclusive with |
4612+
| --unset-default-target. |
4613+
| --unset-default-target Unset the default target |
4614+
| for the dbt project. |
4615+
| Mutually exclusive with |
4616+
| --default-target. |
4617+
| --external-access-integr… TEXT External access |
4618+
| integration to be used by |
4619+
| the dbt object. |
4620+
| --install-local-deps Installs local |
4621+
| dependencies from project |
4622+
| that don't require |
4623+
| external access. |
4624+
| --help -h Show this message and |
4625+
| exit. |
46054626
+------------------------------------------------------------------------------+
46064627
+- Connection configuration ---------------------------------------------------+
46074628
| --connection,--environment -c TEXT Name of the connection, as |
@@ -21765,6 +21786,7 @@
2176521786
| auth Manages authentication methods. |
2176621787
| connection Manages connections to Snowflake. |
2176721788
| cortex Provides access to Snowflake Cortex. |
21789+
| dbt Manages dbt on Snowflake projects. |
2176821790
| git Manages git repositories in Snowflake. |
2176921791
| helpers Helper commands. |
2177021792
| init Creates project directory from template. |

tests/dbt/conftest.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import pytest
44
import yaml
55
from snowflake.cli._plugins.dbt.constants import PROFILES_FILENAME
6-
from snowflake.cli.api.feature_flags import FeatureFlag
76

87

98
@pytest.fixture
@@ -38,13 +37,6 @@ def profile():
3837
},
3938
}
4039
}
41-
if FeatureFlag.ENABLE_DBT_GA_FEATURES.is_disabled():
42-
profiles["dev"]["outputs"]["local"]["account"] = "test_account"
43-
profiles["dev"]["outputs"]["local"]["user"] = "test_user"
44-
profiles["dev"]["outputs"]["local"]["warehouse"] = "test_wh"
45-
profiles["dev"]["outputs"]["prod"]["account"] = "test_account"
46-
profiles["dev"]["outputs"]["prod"]["user"] = "test_user"
47-
profiles["dev"]["outputs"]["prod"]["warehouse"] = "test_wh"
4840
return profiles
4941

5042

tests/dbt/test_dbt_commands.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@
2323
PROFILES_FILENAME,
2424
RESULT_COLUMN_NAME,
2525
)
26-
from snowflake.cli.api.feature_flags import FeatureFlag
2726
from snowflake.cli.api.secure_path import SecurePath
2827

29-
from tests_common.feature_flag_utils import with_feature_flags
30-
3128

3229
class TestDBTList:
3330
def test_list_command_alias(self, mock_connect, runner):
@@ -195,7 +192,6 @@ def test_dbt_deploy_with_custom_profiles_dir(
195192
assert str(mock_deploy.call_args[0][0]) == "TEST_PIPELINE"
196193
assert call_kwargs["profiles_path"] == SecurePath(new_profiles_directory)
197194

198-
@with_feature_flags({FeatureFlag.ENABLE_DBT_GA_FEATURES: True})
199195
def test_deploy_with_default_target_passes_to_manager(
200196
self, runner, dbt_project_path, mock_deploy
201197
):
@@ -215,7 +211,6 @@ def test_deploy_with_default_target_passes_to_manager(
215211
assert call_kwargs["default_target"] == "prod"
216212
assert call_kwargs["unset_default_target"] is False
217213

218-
@with_feature_flags({FeatureFlag.ENABLE_DBT_GA_FEATURES: True})
219214
def test_deploy_with_unset_default_target_passes_to_manager(
220215
self, runner, dbt_project_path, mock_deploy
221216
):
@@ -235,7 +230,6 @@ def test_deploy_with_unset_default_target_passes_to_manager(
235230
assert call_kwargs["default_target"] is None
236231
assert call_kwargs["unset_default_target"] is True
237232

238-
@with_feature_flags({FeatureFlag.ENABLE_DBT_GA_FEATURES: True})
239233
def test_deploys_project_with_single_external_access_integration(
240234
self,
241235
runner,
@@ -261,7 +255,6 @@ def test_deploys_project_with_single_external_access_integration(
261255
]
262256
assert call_kwargs["install_local_deps"] is False
263257

264-
@with_feature_flags({FeatureFlag.ENABLE_DBT_GA_FEATURES: True})
265258
def test_deploys_project_with_multiple_external_access_integrations(
266259
self,
267260
runner,
@@ -289,7 +282,6 @@ def test_deploys_project_with_multiple_external_access_integrations(
289282
)
290283
assert call_kwargs["install_local_deps"] is False
291284

292-
@with_feature_flags({FeatureFlag.ENABLE_DBT_GA_FEATURES: True})
293285
def test_deploys_project_with_local_deps(
294286
self,
295287
runner,
@@ -312,7 +304,6 @@ def test_deploys_project_with_local_deps(
312304
assert not call_kwargs["external_access_integrations"]
313305
assert call_kwargs["install_local_deps"] is True
314306

315-
@with_feature_flags({FeatureFlag.ENABLE_DBT_GA_FEATURES: True})
316307
def test_deploy_with_both_default_target_and_unset_default_target_fails(
317308
self,
318309
mock_connect,

tests_e2e/__snapshots__/test_installation.ambr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
| auth Manages authentication methods. |
3434
| connection Manages connections to Snowflake. |
3535
| cortex Provides access to Snowflake Cortex. |
36+
| dbt Manages dbt on Snowflake projects. |
3637
| git Manages git repositories in Snowflake. |
3738
| helpers Helper commands. |
3839
| init Creates project directory from template. |
@@ -96,6 +97,7 @@
9697
| auth Manages authentication methods. |
9798
| connection Manages connections to Snowflake. |
9899
| cortex Provides access to Snowflake Cortex. |
100+
| dbt Manages dbt on Snowflake projects. |
99101
| git Manages git repositories in Snowflake. |
100102
| helpers Helper commands. |
101103
| init Creates project directory from template. |
@@ -140,6 +142,7 @@
140142
| auth Manages authentication methods. |
141143
| connection Manages connections to Snowflake. |
142144
| cortex Provides access to Snowflake Cortex. |
145+
| dbt Manages dbt on Snowflake projects. |
143146
| git Manages git repositories in Snowflake. |
144147
| helpers Helper commands. |
145148
| init Creates project directory from template. |
@@ -223,6 +226,7 @@
223226
| auth Manages authentication methods. |
224227
| connection Manages connections to Snowflake. |
225228
| cortex Provides access to Snowflake Cortex. |
229+
| dbt Manages dbt on Snowflake projects. |
226230
| git Manages git repositories in Snowflake. |
227231
| helpers Helper commands. |
228232
| init Creates project directory from template. |

0 commit comments

Comments
 (0)