mirror of
https://github.com/dbt-labs/dbt-core
synced 2025-12-20 18:21:29 +00:00
Compare commits
5 Commits
enable-pos
...
v1.9.0rc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a84a787eeb | ||
|
|
3d70e1b06f | ||
|
|
55872497bd | ||
|
|
d305137226 | ||
|
|
bda92e7312 |
@@ -1,5 +1,5 @@
|
|||||||
[bumpversion]
|
[bumpversion]
|
||||||
current_version = 1.9.0b4
|
current_version = 1.9.0rc1
|
||||||
parse = (?P<major>[\d]+) # major version number
|
parse = (?P<major>[\d]+) # major version number
|
||||||
\.(?P<minor>[\d]+) # minor version number
|
\.(?P<minor>[\d]+) # minor version number
|
||||||
\.(?P<patch>[\d]+) # patch version number
|
\.(?P<patch>[\d]+) # patch version number
|
||||||
|
|||||||
35
.changes/1.9.0-rc1.md
Normal file
35
.changes/1.9.0-rc1.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
## dbt-core 1.9.0-rc1 - November 25, 2024
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- Parseable JSON and text output in quiet mode for `dbt show` and `dbt compile` ([#9840](https://github.com/dbt-labs/dbt-core/issues/9840))
|
||||||
|
- Change gating of microbatch feature to be behind project flag / behavior flag ([#10798](https://github.com/dbt-labs/dbt-core/issues/10798))
|
||||||
|
- Add new hard_deletes="new_record" mode for snapshots. ([#10235](https://github.com/dbt-labs/dbt-core/issues/10235))
|
||||||
|
- Allow microbatch batches to run in parallel ([#10853](https://github.com/dbt-labs/dbt-core/issues/10853), [#10855](https://github.com/dbt-labs/dbt-core/issues/10855))
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
- override materialization python models ([#8520](https://github.com/dbt-labs/dbt-core/issues/8520))
|
||||||
|
- Support disabling unit tests via config. ([#9109](https://github.com/dbt-labs/dbt-core/issues/9109), [#10540](https://github.com/dbt-labs/dbt-core/issues/10540))
|
||||||
|
- unit tests with versioned refs ([#10880](https://github.com/dbt-labs/dbt-core/issues/10880), [#10528](https://github.com/dbt-labs/dbt-core/issues/10528), [#10623](https://github.com/dbt-labs/dbt-core/issues/10623))
|
||||||
|
- Fix 'no attribute .config' error when ref-ing a microbatch model from non-Model context ([#10928](https://github.com/dbt-labs/dbt-core/issues/10928))
|
||||||
|
- Ensure inferred primary_key is a List[str] with no null values ([#10983](https://github.com/dbt-labs/dbt-core/issues/10983))
|
||||||
|
- Correct when custom microbatch macro deprecation warning is fired ([#10994](https://github.com/dbt-labs/dbt-core/issues/10994))
|
||||||
|
- Validate manifest has group_map during group_lookup init ([#10988](https://github.com/dbt-labs/dbt-core/issues/10988))
|
||||||
|
- Fix plural of 'partial success' in log message ([#10999](https://github.com/dbt-labs/dbt-core/issues/10999))
|
||||||
|
- Emit batch-level exception with node_info on microbatch batch run failure ([#10840](https://github.com/dbt-labs/dbt-core/issues/10840))
|
||||||
|
- Fix restrict-access to not apply within a package ([#10134](https://github.com/dbt-labs/dbt-core/issues/10134))
|
||||||
|
- Make microbatch models skippable ([#11021](https://github.com/dbt-labs/dbt-core/issues/11021))
|
||||||
|
- Catch DbtRuntimeError for hooks ([#11012](https://github.com/dbt-labs/dbt-core/issues/11012))
|
||||||
|
|
||||||
|
### Under the Hood
|
||||||
|
|
||||||
|
- Upgrade protobuf ([#10658](https://github.com/dbt-labs/dbt-core/issues/10658))
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
- Bump minimum dbt-adapters version to 1.9.0 ([#10996](https://github.com/dbt-labs/dbt-core/issues/10996))
|
||||||
|
|
||||||
|
### Contributors
|
||||||
|
- [@devmessias](https://github.com/devmessias) ([#8520](https://github.com/dbt-labs/dbt-core/issues/8520), [#10880](https://github.com/dbt-labs/dbt-core/issues/10880), [#10528](https://github.com/dbt-labs/dbt-core/issues/10528), [#10623](https://github.com/dbt-labs/dbt-core/issues/10623))
|
||||||
|
- [@tsturge](https://github.com/tsturge) ([#9109](https://github.com/dbt-labs/dbt-core/issues/9109), [#10540](https://github.com/dbt-labs/dbt-core/issues/10540))
|
||||||
6
.changes/1.9.0/Features-20241104-120053.yaml
Normal file
6
.changes/1.9.0/Features-20241104-120053.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
kind: Features
|
||||||
|
body: Add new hard_deletes="new_record" mode for snapshots.
|
||||||
|
time: 2024-11-04T12:00:53.95191-05:00
|
||||||
|
custom:
|
||||||
|
Author: peterallenwebb
|
||||||
|
Issue: "10235"
|
||||||
6
.changes/1.9.0/Fixes-20241121-181739.yaml
Normal file
6
.changes/1.9.0/Fixes-20241121-181739.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
kind: Fixes
|
||||||
|
body: Catch DbtRuntimeError for hooks
|
||||||
|
time: 2024-11-21T18:17:39.753235Z
|
||||||
|
custom:
|
||||||
|
Author: aranke
|
||||||
|
Issue: "11012"
|
||||||
38
CHANGELOG.md
38
CHANGELOG.md
@@ -5,6 +5,43 @@
|
|||||||
- "Breaking changes" listed under a version may require action from end users or external maintainers when upgrading to that version.
|
- "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)
|
- 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.9.0-rc1 - November 25, 2024
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- Parseable JSON and text output in quiet mode for `dbt show` and `dbt compile` ([#9840](https://github.com/dbt-labs/dbt-core/issues/9840))
|
||||||
|
- Change gating of microbatch feature to be behind project flag / behavior flag ([#10798](https://github.com/dbt-labs/dbt-core/issues/10798))
|
||||||
|
- Add new hard_deletes="new_record" mode for snapshots. ([#10235](https://github.com/dbt-labs/dbt-core/issues/10235))
|
||||||
|
- Allow microbatch batches to run in parallel ([#10853](https://github.com/dbt-labs/dbt-core/issues/10853), [#10855](https://github.com/dbt-labs/dbt-core/issues/10855))
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
- override materialization python models ([#8520](https://github.com/dbt-labs/dbt-core/issues/8520))
|
||||||
|
- Support disabling unit tests via config. ([#9109](https://github.com/dbt-labs/dbt-core/issues/9109), [#10540](https://github.com/dbt-labs/dbt-core/issues/10540))
|
||||||
|
- unit tests with versioned refs ([#10880](https://github.com/dbt-labs/dbt-core/issues/10880), [#10528](https://github.com/dbt-labs/dbt-core/issues/10528), [#10623](https://github.com/dbt-labs/dbt-core/issues/10623))
|
||||||
|
- Fix 'no attribute .config' error when ref-ing a microbatch model from non-Model context ([#10928](https://github.com/dbt-labs/dbt-core/issues/10928))
|
||||||
|
- Ensure inferred primary_key is a List[str] with no null values ([#10983](https://github.com/dbt-labs/dbt-core/issues/10983))
|
||||||
|
- Correct when custom microbatch macro deprecation warning is fired ([#10994](https://github.com/dbt-labs/dbt-core/issues/10994))
|
||||||
|
- Validate manifest has group_map during group_lookup init ([#10988](https://github.com/dbt-labs/dbt-core/issues/10988))
|
||||||
|
- Fix plural of 'partial success' in log message ([#10999](https://github.com/dbt-labs/dbt-core/issues/10999))
|
||||||
|
- Emit batch-level exception with node_info on microbatch batch run failure ([#10840](https://github.com/dbt-labs/dbt-core/issues/10840))
|
||||||
|
- Fix restrict-access to not apply within a package ([#10134](https://github.com/dbt-labs/dbt-core/issues/10134))
|
||||||
|
- Make microbatch models skippable ([#11021](https://github.com/dbt-labs/dbt-core/issues/11021))
|
||||||
|
- Catch DbtRuntimeError for hooks ([#11012](https://github.com/dbt-labs/dbt-core/issues/11012))
|
||||||
|
|
||||||
|
### Under the Hood
|
||||||
|
|
||||||
|
- Upgrade protobuf ([#10658](https://github.com/dbt-labs/dbt-core/issues/10658))
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
- Bump minimum dbt-adapters version to 1.9.0 ([#10996](https://github.com/dbt-labs/dbt-core/issues/10996))
|
||||||
|
|
||||||
|
### Contributors
|
||||||
|
- [@devmessias](https://github.com/devmessias) ([#8520](https://github.com/dbt-labs/dbt-core/issues/8520), [#10880](https://github.com/dbt-labs/dbt-core/issues/10880), [#10528](https://github.com/dbt-labs/dbt-core/issues/10528), [#10623](https://github.com/dbt-labs/dbt-core/issues/10623))
|
||||||
|
- [@tsturge](https://github.com/tsturge) ([#9109](https://github.com/dbt-labs/dbt-core/issues/9109), [#10540](https://github.com/dbt-labs/dbt-core/issues/10540))
|
||||||
|
|
||||||
|
|
||||||
## dbt-core 1.9.0-b4 - November 06, 2024
|
## dbt-core 1.9.0-b4 - November 06, 2024
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
@@ -25,7 +62,6 @@
|
|||||||
### Contributors
|
### Contributors
|
||||||
- [@DevonFulcher](https://github.com/DevonFulcher) ([#10959](https://github.com/dbt-labs/dbt-core/issues/10959), [#10960](https://github.com/dbt-labs/dbt-core/issues/10960))
|
- [@DevonFulcher](https://github.com/DevonFulcher) ([#10959](https://github.com/dbt-labs/dbt-core/issues/10959), [#10960](https://github.com/dbt-labs/dbt-core/issues/10960))
|
||||||
|
|
||||||
|
|
||||||
## dbt-core 1.9.0-b3 - October 30, 2024
|
## dbt-core 1.9.0-b3 - October 30, 2024
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class SnapshotMetaColumnNames(dbtClassMixin):
|
|||||||
dbt_valid_from: Optional[str] = None
|
dbt_valid_from: Optional[str] = None
|
||||||
dbt_scd_id: Optional[str] = None
|
dbt_scd_id: Optional[str] = None
|
||||||
dbt_updated_at: Optional[str] = None
|
dbt_updated_at: Optional[str] = None
|
||||||
|
dbt_is_deleted: Optional[str] = None
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@@ -37,6 +38,7 @@ class SnapshotConfig(NodeConfig):
|
|||||||
"dbt_valid_to": self.snapshot_meta_column_names.dbt_valid_to or "dbt_valid_to",
|
"dbt_valid_to": self.snapshot_meta_column_names.dbt_valid_to or "dbt_valid_to",
|
||||||
"dbt_scd_id": self.snapshot_meta_column_names.dbt_scd_id or "dbt_scd_id",
|
"dbt_scd_id": self.snapshot_meta_column_names.dbt_scd_id or "dbt_scd_id",
|
||||||
"dbt_updated_at": self.snapshot_meta_column_names.dbt_updated_at or "dbt_updated_at",
|
"dbt_updated_at": self.snapshot_meta_column_names.dbt_updated_at or "dbt_updated_at",
|
||||||
|
"dbt_is_deleted": self.snapshot_meta_column_names.dbt_is_deleted or "dbt_is_deleted",
|
||||||
}
|
}
|
||||||
|
|
||||||
def final_validate(self):
|
def final_validate(self):
|
||||||
|
|||||||
@@ -922,7 +922,7 @@ class RunTask(CompileTask):
|
|||||||
try:
|
try:
|
||||||
with adapter.connection_named("master"):
|
with adapter.connection_named("master"):
|
||||||
self.safe_run_hooks(adapter, RunHookType.End, extras)
|
self.safe_run_hooks(adapter, RunHookType.End, extras)
|
||||||
except (KeyboardInterrupt, SystemExit):
|
except (KeyboardInterrupt, SystemExit, DbtRuntimeError):
|
||||||
run_result = self.get_result(
|
run_result = self.get_result(
|
||||||
results=self.node_results,
|
results=self.node_results,
|
||||||
elapsed_time=time.time() - self.started_at,
|
elapsed_time=time.time() - self.started_at,
|
||||||
|
|||||||
@@ -231,5 +231,5 @@ def _get_adapter_plugin_names() -> Iterator[str]:
|
|||||||
yield plugin_name
|
yield plugin_name
|
||||||
|
|
||||||
|
|
||||||
__version__ = "1.9.0b4"
|
__version__ = "1.9.0rc1"
|
||||||
installed = get_installed_version()
|
installed = get_installed_version()
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ with open(os.path.join(this_directory, "README.md")) as f:
|
|||||||
|
|
||||||
|
|
||||||
package_name = "dbt-core"
|
package_name = "dbt-core"
|
||||||
package_version = "1.9.0b4"
|
package_version = "1.9.0rc1"
|
||||||
description = """With dbt, data analysts and engineers can build analytics \
|
description = """With dbt, data analysts and engineers can build analytics \
|
||||||
the way engineers build applications."""
|
the way engineers build applications."""
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ setup(
|
|||||||
# Pin to the patch or minor version, and bump in each new minor version of dbt-core.
|
# Pin to the patch or minor version, and bump in each new minor version of dbt-core.
|
||||||
"agate>=1.7.0,<1.10",
|
"agate>=1.7.0,<1.10",
|
||||||
"Jinja2>=3.1.3,<4",
|
"Jinja2>=3.1.3,<4",
|
||||||
"mashumaro[msgpack]>=3.9,<4.0",
|
"mashumaro[msgpack]>=3.9,<3.15",
|
||||||
# ----
|
# ----
|
||||||
# dbt-core uses these packages in standard ways. Pin to the major version, and check compatibility
|
# dbt-core uses these packages in standard ways. Pin to the major version, and check compatibility
|
||||||
# with major versions in each new minor version of dbt-core.
|
# with major versions in each new minor version of dbt-core.
|
||||||
|
|||||||
@@ -6754,6 +6754,17 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"default": null
|
"default": null
|
||||||
|
},
|
||||||
|
"dbt_is_deleted": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"default": null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
@@ -16672,6 +16683,17 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"default": null
|
"default": null
|
||||||
|
},
|
||||||
|
"dbt_is_deleted": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"default": null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ import pytest
|
|||||||
|
|
||||||
from dbt.artifacts.schemas.results import RunStatus
|
from dbt.artifacts.schemas.results import RunStatus
|
||||||
from dbt.contracts.graph.nodes import HookNode
|
from dbt.contracts.graph.nodes import HookNode
|
||||||
from dbt.tests.util import get_artifact, run_dbt_and_capture
|
from dbt.tests.util import get_artifact, run_dbt, run_dbt_and_capture
|
||||||
|
from dbt_common.exceptions import CompilationError
|
||||||
|
|
||||||
|
|
||||||
class Test__StartHookFail__FlagIsNone__ModelFail:
|
class Test__StartHookFail__FlagIsNone__ModelFail:
|
||||||
@@ -242,3 +243,36 @@ class Test__HookContext__HookFail:
|
|||||||
assert "Thread ID: main" in log_output
|
assert "Thread ID: main" in log_output
|
||||||
assert results[0].thread_id == "main"
|
assert results[0].thread_id == "main"
|
||||||
assert "Num Results in context: 2" in log_output # failed hook and model
|
assert "Num Results in context: 2" in log_output # failed hook and model
|
||||||
|
|
||||||
|
|
||||||
|
class Test__HookCompilationError:
|
||||||
|
@pytest.fixture(scope="class")
|
||||||
|
def models(self):
|
||||||
|
return {"my_model.sql": "select 1 as id"}
|
||||||
|
|
||||||
|
@pytest.fixture(scope="class")
|
||||||
|
def macros(self):
|
||||||
|
return {
|
||||||
|
"rce.sql": """
|
||||||
|
{% macro rce(relation) %}
|
||||||
|
{% if execute %}
|
||||||
|
{{ exceptions.raise_compiler_error("Always raise a compiler error in execute") }}
|
||||||
|
{% endif %}
|
||||||
|
{% endmacro %}
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
|
||||||
|
@pytest.fixture(scope="class")
|
||||||
|
def project_config_update(self):
|
||||||
|
return {
|
||||||
|
"on-run-end": ["{{ rce() }}"],
|
||||||
|
}
|
||||||
|
|
||||||
|
def test_results(self, project):
|
||||||
|
with pytest.raises(CompilationError, match="Always raise a compiler error in execute"):
|
||||||
|
run_dbt(["run"], expect_pass=False)
|
||||||
|
|
||||||
|
run_results = get_artifact(project.project_root, "target", "run_results.json")
|
||||||
|
assert [(result["unique_id"], result["status"]) for result in run_results["results"]] == [
|
||||||
|
("model.test.my_model", RunStatus.Success)
|
||||||
|
]
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ def get_rendered_snapshot_config(**updates):
|
|||||||
"dbt_valid_from": None,
|
"dbt_valid_from": None,
|
||||||
"dbt_updated_at": None,
|
"dbt_updated_at": None,
|
||||||
"dbt_scd_id": None,
|
"dbt_scd_id": None,
|
||||||
|
"dbt_is_deleted": None,
|
||||||
},
|
},
|
||||||
"dbt_valid_to_current": None,
|
"dbt_valid_to_current": None,
|
||||||
"tags": [],
|
"tags": [],
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ class TestList:
|
|||||||
"dbt_updated_at": None,
|
"dbt_updated_at": None,
|
||||||
"dbt_valid_from": None,
|
"dbt_valid_from": None,
|
||||||
"dbt_valid_to": None,
|
"dbt_valid_to": None,
|
||||||
|
"dbt_is_deleted": None,
|
||||||
},
|
},
|
||||||
"unique_key": "id",
|
"unique_key": "id",
|
||||||
"strategy": "timestamp",
|
"strategy": "timestamp",
|
||||||
|
|||||||
Reference in New Issue
Block a user