From 95d087b51b24d59bb249c4a7717f2bcb5d936057 Mon Sep 17 00:00:00 2001 From: leahwicz <60146280+leahwicz@users.noreply.github.com> Date: Thu, 4 Nov 2021 06:19:36 -0400 Subject: [PATCH] Bumping artifact versions for v1 (#4191) * Bumping artifact versions for v1 * Adding schema in Changelog * Update CHANGELOG.md * Update changelog entry Co-authored-by: Jeremy Cohen --- CHANGELOG.md | 4 ++++ core/dbt/contracts/graph/manifest.py | 2 +- core/dbt/contracts/results.py | 4 ++-- .../029_docs_generate_tests/test_docs_generate.py | 8 ++++---- test/integration/042_sources_test/test_sources.py | 2 +- test/unit/test_manifest.py | 6 +++--- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0615d5f4d6..19318c1692a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,13 @@ ### Features - Allow nullable `error_after` in source freshness ([#3874](https://github.com/dbt-labs/dbt-core/issues/3874), [#3955](https://github.com/dbt-labs/dbt-core/pull/3955)) - Increase performance of graph subset selection ([#4135](https://github.com/dbt-labs/dbt-core/issues/4135),[#4155](https://github.com/dbt-labs/dbt-core/pull/4155)) + ### Fixes - Changes unit tests using `assertRaisesRegexp` to `assertRaisesRegex` +### Under the hood +- Bump artifact schema versions for 1.0.0: manifest v4, run results v4, sources v3. Notable changes: schema test + data test nodes are renamed to generic test + singular test nodes; freshness threshold default values ([#4191](https://github.com/dbt-labs/dbt-core/pull/4191)) + Contributors: - [@kadero](https://github.com/kadero) ([3955](https://github.com/dbt-labs/dbt-core/pull/3955)) - [@frankcash](https://github.com/frankcash) ([4136](https://github.com/dbt-labs/dbt-core/pull/4136)) diff --git a/core/dbt/contracts/graph/manifest.py b/core/dbt/contracts/graph/manifest.py index 72300e9b525..ad2e75e6760 100644 --- a/core/dbt/contracts/graph/manifest.py +++ b/core/dbt/contracts/graph/manifest.py @@ -1072,7 +1072,7 @@ def __init__(self, macros): @dataclass -@schema_version('manifest', 3) +@schema_version('manifest', 4) class WritableManifest(ArtifactMixin): nodes: Mapping[UniqueID, ManifestNode] = field( metadata=dict(description=( diff --git a/core/dbt/contracts/results.py b/core/dbt/contracts/results.py index e77bfc97eea..a6b5307ea8b 100644 --- a/core/dbt/contracts/results.py +++ b/core/dbt/contracts/results.py @@ -185,7 +185,7 @@ def write(self, path: str): @dataclass -@schema_version('run-results', 3) +@schema_version('run-results', 4) class RunResultsArtifact(ExecutionResult, ArtifactMixin): results: Sequence[RunResultOutput] args: Dict[str, Any] = field(default_factory=dict) @@ -369,7 +369,7 @@ def from_node_results( @dataclass -@schema_version('sources', 2) +@schema_version('sources', 3) class FreshnessExecutionResultArtifact( ArtifactMixin, VersionedSchema, diff --git a/test/integration/029_docs_generate_tests/test_docs_generate.py b/test/integration/029_docs_generate_tests/test_docs_generate.py index 7ad0219becc..09ec8704db6 100644 --- a/test/integration/029_docs_generate_tests/test_docs_generate.py +++ b/test/integration/029_docs_generate_tests/test_docs_generate.py @@ -644,7 +644,7 @@ def expected_seeded_manifest(self, model_database=None, quote_model=False): ) return { - 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v3.json', + 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v4.json', 'dbt_version': dbt.version.__version__, 'nodes': { 'model.test.model': { @@ -1231,7 +1231,7 @@ def expected_postgres_references_manifest(self, model_database=None): snapshot_path = self.dir('snapshot/snapshot_seed.sql') return { - 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v3.json', + 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v4.json', 'dbt_version': dbt.version.__version__, 'nodes': { 'model.test.ephemeral_copy': { @@ -1812,7 +1812,7 @@ def verify_manifest(self, expected_manifest): elif key == 'metadata': metadata = manifest['metadata'] self.verify_metadata( - metadata, 'https://schemas.getdbt.com/dbt/manifest/v3.json') + metadata, 'https://schemas.getdbt.com/dbt/manifest/v4.json') assert 'project_id' in metadata and metadata[ 'project_id'] == '098f6bcd4621d373cade4e832627b4f6' assert 'send_anonymous_usage_stats' in metadata and metadata[ @@ -1952,7 +1952,7 @@ def verify_run_results(self, expected_run_results): run_results = _read_json('./target/run_results.json') assert 'metadata' in run_results self.verify_metadata( - run_results['metadata'], 'https://schemas.getdbt.com/dbt/run-results/v3.json') + run_results['metadata'], 'https://schemas.getdbt.com/dbt/run-results/v4.json') self.assertIn('elapsed_time', run_results) self.assertGreater(run_results['elapsed_time'], 0) self.assertTrue( diff --git a/test/integration/042_sources_test/test_sources.py b/test/integration/042_sources_test/test_sources.py index e9362fd2517..f89a6847094 100644 --- a/test/integration/042_sources_test/test_sources.py +++ b/test/integration/042_sources_test/test_sources.py @@ -248,7 +248,7 @@ def _assert_freshness_results(self, path, state): assert isinstance(data['elapsed_time'], float) self.assertBetween(data['metadata']['generated_at'], self.freshness_start_time) - assert data['metadata']['dbt_schema_version'] == 'https://schemas.getdbt.com/dbt/sources/v2.json' + assert data['metadata']['dbt_schema_version'] == 'https://schemas.getdbt.com/dbt/sources/v3.json' assert data['metadata']['dbt_version'] == dbt.version.__version__ assert data['metadata']['invocation_id'] == dbt.tracking.active_user.invocation_id key = 'key' diff --git a/test/unit/test_manifest.py b/test/unit/test_manifest.py index 7d303c9990e..27d2639ffd2 100644 --- a/test/unit/test_manifest.py +++ b/test/unit/test_manifest.py @@ -272,7 +272,7 @@ def test__no_nodes(self): 'child_map': {}, 'metadata': { 'generated_at': '2018-02-14T09:15:13Z', - 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v3.json', + 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v4.json', 'dbt_version': dbt.version.__version__, 'env': {ENV_KEY_NAME: 'value'}, # invocation_id is None, so it will not be present @@ -418,7 +418,7 @@ def test_no_nodes_with_metadata(self, mock_user): 'docs': {}, 'metadata': { 'generated_at': '2018-02-14T09:15:13Z', - 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v3.json', + 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v4.json', 'dbt_version': dbt.version.__version__, 'project_id': '098f6bcd4621d373cade4e832627b4f6', 'user_id': 'cfc9500f-dc7f-4c83-9ea7-2c581c1b38cf', @@ -659,7 +659,7 @@ def test__no_nodes(self): 'child_map': {}, 'metadata': { 'generated_at': '2018-02-14T09:15:13Z', - 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v3.json', + 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v4.json', 'dbt_version': dbt.version.__version__, 'invocation_id': '01234567-0123-0123-0123-0123456789ab', 'env': {ENV_KEY_NAME: 'value'},