Compare commits

...

2 Commits

Author SHA1 Message Date
Michelle Ark
2e4d6632d6 Merge branch 'main' into deprecate-models-flag2 2025-05-29 16:54:38 -04:00
Michelle Ark
45a0a7cb33 new models param deprecation 2025-05-23 13:42:16 -04:00
2 changed files with 50 additions and 1 deletions

View File

@@ -73,7 +73,7 @@ setup(
# Minor versions for these are expected to be backwards-compatible
"dbt-common>=1.22.0,<2.0",
"dbt-adapters>=1.15.2,<2.0",
"dbt-protos>=1.0.312,<2.0",
"dbt-protos>=1.0.315,<2.0",
# ----
# Expect compatibility with all new versions of these packages, so lower bounds only.
"packaging>20.9",

View File

@@ -15,6 +15,7 @@ from dbt.events.types import (
DeprecationsSummary,
DuplicateYAMLKeysDeprecation,
GenericJSONSchemaValidationDeprecation,
ModelParamUsageDeprecation,
PackageRedirectDeprecation,
WEOIncludeExcludeDeprecation,
)
@@ -491,3 +492,51 @@ class TestWEOIncludeExcludeDeprecation:
assert "exclude" in event_catcher.caught_events[0].info.msg
else:
assert "exclude" not in event_catcher.caught_events[0].info.msg
class TestModelsParamUsageDeprecation:
def test_models_usage(self, project):
event_catcher = EventCatcher(ModelParamUsageDeprecation)
assert len(event_catcher.caught_events) == 0
run_dbt(
["ls", "--models", "some_model"],
callbacks=[event_catcher.catch],
)
assert len(event_catcher.caught_events) == 1
class TestModelParamUsageDeprecation:
def test_model_usage(self, project):
event_catcher = EventCatcher(ModelParamUsageDeprecation)
assert len(event_catcher.caught_events) == 0
run_dbt(
["ls", "--model", "some_model"],
callbacks=[event_catcher.catch],
)
assert len(event_catcher.caught_events) == 1
class TestMParamUsageDeprecation:
def test_m_usage(self, project):
event_catcher = EventCatcher(ModelParamUsageDeprecation)
assert len(event_catcher.caught_events) == 0
run_dbt(
["ls", "-m", "some_model"],
callbacks=[event_catcher.catch],
)
assert len(event_catcher.caught_events) == 1
class TestSelectParamNoModelUsageDeprecation:
def test_select_usage(self, project):
event_catcher = EventCatcher(ModelParamUsageDeprecation)
assert len(event_catcher.caught_events) == 0
run_dbt(
["ls", "--select", "some_model"],
callbacks=[event_catcher.catch],
)
assert len(event_catcher.caught_events) == 0