Skip to content

Commit

Permalink
Merge branch '1.6.latest' into backport-8670-to-1.6.latest
Browse files Browse the repository at this point in the history
  • Loading branch information
aranke authored Oct 11, 2023
2 parents c107422 + de6b75b commit bc4965a
Show file tree
Hide file tree
Showing 58 changed files with 1,011 additions and 134 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.6.3
current_version = 1.6.5
parse = (?P<major>[\d]+) # major version number
\.(?P<minor>[\d]+) # minor version number
\.(?P<patch>[\d]+) # patch version number
Expand Down
18 changes: 18 additions & 0 deletions .changes/1.6.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## dbt-core 1.6.4 - September 28, 2023

### Features

- Add support for optional label in semantic_models, measures, dimensions and entities. ([#8595](https://github.com/dbt-labs/dbt-core/issues/8595))

### Fixes

- update dbt show to include limit in DWH query ([#8496,](https://github.com/dbt-labs/dbt-core/issues/8496,), [#8417](https://github.com/dbt-labs/dbt-core/issues/8417))
- Support quoted parameter list for MultiOption CLI options. ([#8598](https://github.com/dbt-labs/dbt-core/issues/8598))
- Fixes test type edges filter ([#8692](https://github.com/dbt-labs/dbt-core/issues/8692))
- semantic models in graph selection ([#8589](https://github.com/dbt-labs/dbt-core/issues/8589))
- Support doc blocks in nested semantic model YAML ([#8509](https://github.com/dbt-labs/dbt-core/issues/8509))
- avoid double-rendering sql_header in dbt show ([#8739](https://github.com/dbt-labs/dbt-core/issues/8739))

### Contributors
- [@dave-connors-3](https://github.com/dave-connors-3) ([#8589](https://github.com/dbt-labs/dbt-core/issues/8589))
- [@renanleme](https://github.com/renanleme) ([#8692](https://github.com/dbt-labs/dbt-core/issues/8692))
5 changes: 5 additions & 0 deletions .changes/1.6.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## dbt-core 1.6.5 - October 02, 2023

### Fixes

- Fix tag selection for projects with semantic models ([#8749](https://github.com/dbt-labs/dbt-core/issues/8749))
7 changes: 0 additions & 7 deletions .changes/unreleased/Features-20230914-074429.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions .changes/unreleased/Features-20230918-150855.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions .changes/unreleased/Features-20230922-150754.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Support `fill_nulls_with` and `join_to_timespine` for metric nodes
time: 2023-09-22T15:07:54.981752-07:00
custom:
Author: QMalcolm
Issue: "8593"
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20230810-184859.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Add connection status into list of statuses for dbt debug
time: 2023-08-10T18:48:59.221344+01:00
custom:
Author: aranke
Issue: "8350"
6 changes: 0 additions & 6 deletions .changes/unreleased/Fixes-20230913-153924.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions .changes/unreleased/Fixes-20230922-223313.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions .changes/unreleased/Fixes-20230925-233306.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions .changes/unreleased/Fixes-20230926-001527.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20231004-075904.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Regenerate the v10 manifest jsonschema
time: 2023-10-04T07:59:04.593928-05:00
custom:
Author: emmyoop
Issue: "8763"
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20231004-144148.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Support docs blocks on versioned model column descriptions
time: 2023-10-04T14:41:48.843486-05:00
custom:
Author: emmyoop
Issue: "8540"
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20231004-154558.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Foreign key constraint on incremental model results in Database Error
time: 2023-10-04T15:45:58.298548+01:00
custom:
Author: aranke
Issue: "8022"
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20231006-134551.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Enable seeds to be handled from stored manifest data
time: 2023-10-06T13:45:51.925546-04:00
custom:
Author: michelleark
Issue: "6875"
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20231010-125948.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Group updates on unmodified nodes are handled gracefully for state:modified
time: 2023-10-10T12:59:48.390113-05:00
custom:
Author: emmyoop
Issue: "8371"
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20231010-182801.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Override path-like args in dbt retry
time: 2023-10-10T18:28:01.556443+01:00
custom:
Author: aranke
Issue: "8682"
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20230912-230619.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: add a test for ephemeral cte injection
time: 2023-09-12T23:06:19.938207+01:00
custom:
Author: michelleark
Issue: "8376"
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,33 @@
- "Breaking changes" listed under a version may require action from end users or external maintainers when upgrading to that version.
- Do not edit this file directly. This file is auto-generated using [changie](https://github.com/miniscruff/changie). For details on how to document a change, see [the contributing guide](https://github.com/dbt-labs/dbt-core/blob/main/CONTRIBUTING.md#adding-changelog-entry)

## dbt-core 1.6.5 - October 02, 2023

### Fixes

- Fix tag selection for projects with semantic models ([#8749](https://github.com/dbt-labs/dbt-core/issues/8749))



## dbt-core 1.6.4 - September 28, 2023

### Features

- Add support for optional label in semantic_models, measures, dimensions and entities. ([#8595](https://github.com/dbt-labs/dbt-core/issues/8595))

### Fixes

- update dbt show to include limit in DWH query ([#8496,](https://github.com/dbt-labs/dbt-core/issues/8496,), [#8417](https://github.com/dbt-labs/dbt-core/issues/8417))
- Support quoted parameter list for MultiOption CLI options. ([#8598](https://github.com/dbt-labs/dbt-core/issues/8598))
- Fixes test type edges filter ([#8692](https://github.com/dbt-labs/dbt-core/issues/8692))
- semantic models in graph selection ([#8589](https://github.com/dbt-labs/dbt-core/issues/8589))
- Support doc blocks in nested semantic model YAML ([#8509](https://github.com/dbt-labs/dbt-core/issues/8509))
- avoid double-rendering sql_header in dbt show ([#8739](https://github.com/dbt-labs/dbt-core/issues/8739))

### Contributors
- [@dave-connors-3](https://github.com/dave-connors-3) ([#8589](https://github.com/dbt-labs/dbt-core/issues/8589))
- [@renanleme](https://github.com/renanleme) ([#8692](https://github.com/dbt-labs/dbt-core/issues/8692))

## dbt-core 1.6.3 - September 19, 2023

### Features
Expand All @@ -24,7 +51,6 @@
- [@benmosher](https://github.com/benmosher) ([#8480](https://github.com/dbt-labs/dbt-core/issues/8480))
- [@dave-connors-3](https://github.com/dave-connors-3) ([#8153](https://github.com/dbt-labs/dbt-core/issues/8153))


## dbt-core 1.6.2 - September 07, 2023

### Breaking Changes
Expand Down
14 changes: 12 additions & 2 deletions core/dbt/context/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,8 +862,18 @@ def try_or_compiler_error(
def load_agate_table(self) -> agate.Table:
if not isinstance(self.model, SeedNode):
raise LoadAgateTableNotSeedError(self.model.resource_type, node=self.model)
assert self.model.root_path
path = os.path.join(self.model.root_path, self.model.original_file_path)

# include package_path for seeds defined in packages
package_path = (
os.path.join(self.config.packages_install_path, self.model.package_name)
if self.model.package_name != self.config.project_name
else "."
)
path = os.path.join(self.config.project_root, package_path, self.model.original_file_path)
if not os.path.exists(path):
assert self.model.root_path
path = os.path.join(self.model.root_path, self.model.original_file_path)

column_types = self.model.config.column_types
try:
table = agate_helper.from_csv(path, text_columns=column_types)
Expand Down
9 changes: 8 additions & 1 deletion core/dbt/contracts/graph/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,14 @@ def build_group_map(self):
group_map = {group.name: [] for group in self.groups.values()}
for node in groupable_nodes:
if node.group is not None:
group_map[node.group].append(node.unique_id)
# group updates are not included with state:modified and
# by ignoring the groups that aren't in the group map we
# can avoid hitting errors for groups that are not getting
# updated. This is a hack but any groups that are not
# valid will be caught in
# parser.manifest.ManifestLoader.check_valid_group_config_node
if node.group in group_map:
group_map[node.group].append(node.unique_id)
self.group_map = group_map

def writable_manifest(self) -> "WritableManifest":
Expand Down
2 changes: 2 additions & 0 deletions core/dbt/contracts/graph/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,8 @@ class MetricInputMeasure(dbtClassMixin):
name: str
filter: Optional[WhereFilter] = None
alias: Optional[str] = None
join_to_timespine: bool = False
fill_nulls_with: Optional[int] = None

def measure_reference(self) -> MeasureReference:
return MeasureReference(element_name=self.name)
Expand Down
2 changes: 2 additions & 0 deletions core/dbt/contracts/graph/unparsed.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,8 @@ class UnparsedMetricInputMeasure(dbtClassMixin):
name: str
filter: Optional[str] = None
alias: Optional[str] = None
join_to_timespine: bool = False
fill_nulls_with: Optional[int] = None


@dataclass
Expand Down
4 changes: 3 additions & 1 deletion core/dbt/graph/selector_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ class TagSelectorMethod(SelectorMethod):
def search(self, included_nodes: Set[UniqueId], selector: str) -> Iterator[UniqueId]:
"""yields nodes from included that have the specified tag"""
for node, real_node in self.all_nodes(included_nodes):
if any(fnmatch(tag, selector) for tag in real_node.tags):
if hasattr(real_node, "tags") and any(
fnmatch(tag, selector) for tag in real_node.tags
):
yield node


Expand Down
2 changes: 0 additions & 2 deletions core/dbt/include/global_project/macros/adapters/show.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% macro get_show_sql(compiled_code, sql_header, limit) -%}
{%- set sql_header = sql_header -%}
{{ sql_header if sql_header is not none }}
{%- if sql_header -%}
{{ sql_header }}
{%- endif -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
create {% if temporary: -%}temporary{%- endif %} table
{{ relation.include(database=(not temporary), schema=(not temporary)) }}
{% set contract_config = config.get('contract') %}
{% if contract_config.enforced %}
{% if contract_config.enforced and (not temporary) %}
{{ get_assert_columns_equivalent(sql) }}
{{ get_table_columns_and_constraints() }}
{%- set sql = get_select_subquery(sql) %}
Expand Down
4 changes: 3 additions & 1 deletion core/dbt/parser/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1115,10 +1115,12 @@ def update_semantic_model(self, semantic_model) -> None:
database=refd_node.database,
)

# nodes: node and column descriptions
# nodes: node and column descriptions, version columns descriptions
# sources: source and table descriptions, column descriptions
# macros: macro argument descriptions
# exposures: exposure descriptions
# metrics: metric descriptions
# semantic_models: semantic model descriptions
def process_docs(self, config: RuntimeConfig):
for node in self.manifest.nodes.values():
if node.created_at < self.started_at:
Expand Down
6 changes: 6 additions & 0 deletions core/dbt/parser/schema_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@ def _is_norender_key(self, keypath: Keypath) -> bool:
Return True if it's tests or description - those aren't rendered now
because they're rendered later in parse_generic_tests or process_docs.
"""
# top level descriptions and tests
if len(keypath) >= 1 and keypath[0] in ("tests", "description"):
return True

# columns descriptions and tests
if len(keypath) == 2 and keypath[1] in ("tests", "description"):
return True

# versions
if len(keypath) == 5 and keypath[4] == "description":
return True

if (
len(keypath) >= 3
and keypath[0] in ("columns", "dimensions", "measures", "entities")
Expand Down
2 changes: 2 additions & 0 deletions core/dbt/parser/schema_yaml_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ def _get_input_measure(
name=unparsed_input_measure.name,
filter=filter,
alias=unparsed_input_measure.alias,
join_to_timespine=unparsed_input_measure.join_to_timespine,
fill_nulls_with=unparsed_input_measure.fill_nulls_with,
)

def _get_optional_input_measure(
Expand Down
3 changes: 2 additions & 1 deletion core/dbt/task/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,14 @@ def run(self) -> bool:
dependencies_statuses = self.test_dependencies()

# Test connection
self.test_connection()
connection_status = self.test_connection()

# Log messages from any fails
all_statuses: List[SubtaskStatus] = [
load_profile_status,
load_project_status,
*dependencies_statuses,
connection_status,
]
all_failing_statuses: List[SubtaskStatus] = list(
filter(lambda status: status.run_status == RunStatus.Error, all_statuses)
Expand Down
18 changes: 17 additions & 1 deletion core/dbt/task/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
from dbt.task.test import TestTask

RETRYABLE_STATUSES = {NodeStatus.Error, NodeStatus.Fail, NodeStatus.Skipped, NodeStatus.RuntimeErr}
OVERRIDE_PARENT_FLAGS = {
"log_path",
"output_path",
"profiles_dir",
"profiles_dir_exists_false",
"project_dir",
"defer_state",
"deprecated_state",
"target_path",
}

TASK_DICT = {
"build": BuildTask,
Expand Down Expand Up @@ -91,7 +101,13 @@ def run(self):
if k in self.previous_args and v(self.previous_args[k]):
del self.previous_args[k]

retry_flags = Flags.from_dict(cli_command, self.previous_args)
previous_args = {
k: v for k, v in self.previous_args.items() if k not in OVERRIDE_PARENT_FLAGS
}
current_args = {k: v for k, v in self.args.__dict__.items() if k in OVERRIDE_PARENT_FLAGS}
combined_args = {**previous_args, **current_args}

retry_flags = Flags.from_dict(cli_command, combined_args)
retry_config = RuntimeConfig.from_args(args=retry_flags)

class TaskWrapper(self.task_class):
Expand Down
4 changes: 4 additions & 0 deletions core/dbt/tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ def rm_dir(directory_path):
raise FileNotFoundError(f"{directory_path} does not exist.")


def rename_dir(src_directory_path, dest_directory_path):
os.rename(src_directory_path, dest_directory_path)


# Get an artifact (usually from the target directory) such as
# manifest.json or catalog.json to use in a test
def get_artifact(*paths):
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,5 @@ def _get_adapter_plugin_names() -> Iterator[str]:
yield plugin_name


__version__ = "1.6.3"
__version__ = "1.6.5"
installed = get_installed_version()
2 changes: 1 addition & 1 deletion core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


package_name = "dbt-core"
package_version = "1.6.3"
package_version = "1.6.5"
description = """With dbt, data analysts and engineers can build analytics \
the way engineers build applications."""

Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ types-mock
types-protobuf
types-python-dateutil
types-pytz
types-requests
types-requests < 2.31.0 # types-requests 2.31.0.8 requires urllib3>=2, but we pin urllib3 ~= 1.0 because of openssl requirement for requests
types-setuptools
wheel
mocker
Loading

0 comments on commit bc4965a

Please sign in to comment.