From 2a99431c8df3e61c4fdf71dd7d78ff9b3db62e41 Mon Sep 17 00:00:00 2001 From: leahwicz <60146280+leahwicz@users.noreply.github.com> Date: Fri, 24 Sep 2021 09:05:42 -0400 Subject: [PATCH] Bumping artifact versions for 0.21 (#3945) (#3949) * Bumping artifact versions for 0.21 * Adding sources bump * Updating some tests * Updated sources test * Adding changelog update --- CHANGELOG.md | 3 +++ core/dbt/contracts/graph/manifest.py | 2 +- core/dbt/contracts/results.py | 4 ++-- .../029_docs_generate_tests/test_docs_generate.py | 12 ++++++------ test/integration/042_sources_test/test_sources.py | 2 +- test/unit/test_manifest.py | 6 +++--- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34b916ea036..5508591212d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ### Fixes - Fix batching for large seeds on Snowflake ([#3941](https://github.com/dbt-labs/dbt/issues/3941), [#3942](https://github.com/dbt-labs/dbt/pull/3942)) +### Under the hood +- Bump artifact schema versions for 0.21.0 ([#3945](https://github.com/dbt-labs/dbt/pull/3945)) + ## dbt 0.21.0rc1 (September 20, 2021) ### Features diff --git a/core/dbt/contracts/graph/manifest.py b/core/dbt/contracts/graph/manifest.py index 265fb88e0e2..fffa5d07b8a 100644 --- a/core/dbt/contracts/graph/manifest.py +++ b/core/dbt/contracts/graph/manifest.py @@ -1071,7 +1071,7 @@ def __init__(self, macros): @dataclass -@schema_version('manifest', 2) +@schema_version('manifest', 3) 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 b3adfece719..e77bfc97eea 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', 2) +@schema_version('run-results', 3) 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', 1) +@schema_version('sources', 2) 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 95fa20c449c..94b25af23f0 100644 --- a/test/integration/029_docs_generate_tests/test_docs_generate.py +++ b/test/integration/029_docs_generate_tests/test_docs_generate.py @@ -1093,7 +1093,7 @@ def expected_seeded_manifest(self, model_database=None, quote_model=False): ) return { - 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v2.json', + 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v3.json', 'dbt_version': dbt.version.__version__, 'nodes': { 'model.test.model': { @@ -1680,7 +1680,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/v2.json', + 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v3.json', 'dbt_version': dbt.version.__version__, 'nodes': { 'model.test.ephemeral_copy': { @@ -2203,7 +2203,7 @@ def expected_bigquery_complex_manifest(self): my_schema_name = self.unique_schema() return { - 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v2.json', + 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v3.json', 'dbt_version': dbt.version.__version__, 'nodes': { 'model.test.clustered': { @@ -2695,7 +2695,7 @@ def expected_redshift_incremental_view_manifest(self): snapshot_path = self.dir('snapshot/snapshot_seed.sql') return { - 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v2.json', + 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v3.json', 'dbt_version': dbt.version.__version__, 'nodes': { 'model.test.model': { @@ -2959,7 +2959,7 @@ def verify_manifest(self, expected_manifest): elif key == 'metadata': metadata = manifest['metadata'] self.verify_metadata( - metadata, 'https://schemas.getdbt.com/dbt/manifest/v2.json') + metadata, 'https://schemas.getdbt.com/dbt/manifest/v3.json') assert 'project_id' in metadata and metadata[ 'project_id'] == '098f6bcd4621d373cade4e832627b4f6' assert 'send_anonymous_usage_stats' in metadata and metadata[ @@ -3100,7 +3100,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/v2.json') + run_results['metadata'], 'https://schemas.getdbt.com/dbt/run-results/v3.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 2f8e2bc87ce..7db72c961d6 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/v1.json' + assert data['metadata']['dbt_schema_version'] == 'https://schemas.getdbt.com/dbt/sources/v2.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 10a6a3f994c..cdfe0bce56a 100644 --- a/test/unit/test_manifest.py +++ b/test/unit/test_manifest.py @@ -273,7 +273,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/v2.json', + 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v3.json', 'dbt_version': dbt.version.__version__, 'env': {ENV_KEY_NAME: 'value'}, # invocation_id is None, so it will not be present @@ -419,7 +419,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/v2.json', + 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v3.json', 'dbt_version': dbt.version.__version__, 'project_id': '098f6bcd4621d373cade4e832627b4f6', 'user_id': 'cfc9500f-dc7f-4c83-9ea7-2c581c1b38cf', @@ -662,7 +662,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/v2.json', + 'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v3.json', 'dbt_version': dbt.version.__version__, 'invocation_id': '01234567-0123-0123-0123-0123456789ab', 'env': {ENV_KEY_NAME: 'value'},