Skip to content

Commit

Permalink
Merge branch 'main' into depends-on-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Sep 30, 2024
2 parents 0744fd7 + 5e3d418 commit a146642
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Features-20240926-151057.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Adds validations for custom_granularities to ensure unique naming.
time: 2024-09-26T15:10:57.907694-07:00
custom:
Author: courtneyholcomb
Issue: "9265"
6 changes: 0 additions & 6 deletions core/dbt/parser/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,17 +412,11 @@ def get_key_dicts(self) -> Iterable[Dict[str, Any]]:

if self.schema_yaml_vars.env_vars:
self.schema_parser.manifest.env_vars.update(self.schema_yaml_vars.env_vars)
schema_file = self.yaml.file
assert isinstance(schema_file, SchemaSourceFile)
for env_var in self.schema_yaml_vars.env_vars.keys():
schema_file.add_env_var(env_var, self.key, entry["name"])
for var in self.schema_yaml_vars.env_vars.keys():
schema_file.add_env_var(var, self.key, entry["name"])
self.schema_yaml_vars.env_vars = {}

if self.schema_yaml_vars.vars:
schema_file = self.yaml.file
assert isinstance(schema_file, SchemaSourceFile)
schema_file.add_vars(self.schema_yaml_vars.vars, self.key, entry["name"])
self.schema_yaml_vars.vars = {}

Expand Down
2 changes: 1 addition & 1 deletion core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
# These are major-version-0 packages also maintained by dbt-labs.
# Accept patches but avoid automatically updating past a set minor version range.
"dbt-extractor>=0.5.0,<=0.6",
"dbt-semantic-interfaces>=0.7.1,<0.8",
"dbt-semantic-interfaces>=0.7.2,<0.8",
# Minor versions for these are expected to be backwards-compatible
"dbt-common>=1.9.0,<2.0",
"dbt-adapters>=1.7.0,<2.0",
Expand Down
7 changes: 7 additions & 0 deletions tests/unit/contracts/graph/test_nodes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from argparse import Namespace
import pickle
import re
from dataclasses import replace
Expand All @@ -24,6 +25,12 @@
)


@pytest.fixture
def args_for_flags() -> Namespace:
return Namespace(
state_modified_compare_vars=False
)

def norm_whitespace(string):
_RE_COMBINE_WHITESPACE = re.compile(r"\s+")
string = _RE_COMBINE_WHITESPACE.sub(" ", string).strip()
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/contracts/graph/test_nodes_parsed.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@


@pytest.fixture
def flags_for_args() -> Namespace:
return Namespace(SEND_ANONYMOUS_USAGE_STATS=False)
def args_for_flags() -> Namespace:
return Namespace(
send_anonymous_usage_stats=False, state_modified_compare_vars=False
)


@pytest.fixture
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/graph/test_selector_methods.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from argparse import Namespace
import copy
from dataclasses import replace
from pathlib import Path
Expand Down Expand Up @@ -643,6 +644,11 @@ def previous_state(manifest):
return create_previous_state(manifest)


@pytest.fixture
def args_for_flags():
return Namespace(state_modified_compare_vars=False)


def add_node(manifest, node):
manifest.nodes[node.unique_id] = node

Expand Down

0 comments on commit a146642

Please sign in to comment.