From f25fb4e5ac128155fa8b645d849cd34630bacdc3 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Fri, 4 Dec 2020 16:49:59 -0500 Subject: [PATCH] Use diff file path for big seed checksum --- CHANGELOG.md | 1 + core/dbt/contracts/files.py | 2 +- test/unit/test_contracts_graph_parsed.py | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 538353442bf..9e596be3ba8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Increased the supported relation name length in postgres from 29 to 51 ([#2850](https://github.com/fishtown-analytics/dbt/pull/2850)) - dbt list command always return 0 as exit code ([#2886](https://github.com/fishtown-analytics/dbt/issues/2886), [#2892](https://github.com/fishtown-analytics/dbt/issues/2892)) - Set default `materialized` for test node configs to `test` ([#2806](https://github.com/fishtown-analytics/dbt/issues/2806), [#2902](https://github.com/fishtown-analytics/dbt/pull/2902)) +- Use original file path instead of absolute path as checksum for big seeds ([#2927](https://github.com/fishtown-analytics/dbt/issues/2927), [#2939](https://github.com/fishtown-analytics/dbt/pull/2939)) ### Under the hood - Bump hologram version to 0.0.11. Add scripts/dtr.py ([#2888](https://github.com/fishtown-analytics/dbt/issues/2840),[#2889](https://github.com/fishtown-analytics/dbt/pull/2889)) diff --git a/core/dbt/contracts/files.py b/core/dbt/contracts/files.py index 0ab18f2e525..ec3798ef7ac 100644 --- a/core/dbt/contracts/files.py +++ b/core/dbt/contracts/files.py @@ -156,7 +156,7 @@ def empty(cls, path: FilePath) -> 'SourceFile': @classmethod def big_seed(cls, path: FilePath) -> 'SourceFile': """Parse seeds over the size limit with just the path""" - self = cls(path=path, checksum=FileHash.path(path.absolute_path)) + self = cls(path=path, checksum=FileHash.path(path.original_file_path)) self.contents = '' return self diff --git a/test/unit/test_contracts_graph_parsed.py b/test/unit/test_contracts_graph_parsed.py index 9161af7ae4a..7fc6566eafd 100644 --- a/test/unit/test_contracts_graph_parsed.py +++ b/test/unit/test_contracts_graph_parsed.py @@ -443,7 +443,7 @@ def basic_parsed_seed_dict(): 'docs': {'show': True}, 'columns': {}, 'meta': {}, - 'checksum': {'name': 'path', 'checksum': '/root/seeds/seed.csv'}, + 'checksum': {'name': 'path', 'checksum': 'seeds/seed.csv'}, 'unrendered_config': {}, } @@ -474,7 +474,7 @@ def basic_parsed_seed_object(): docs=Docs(show=True), columns={}, meta={}, - checksum=FileHash(name='path', checksum='/root/seeds/seed.csv'), + checksum=FileHash(name='path', checksum='seeds/seed.csv'), unrendered_config={}, ) @@ -494,7 +494,7 @@ def minimal_parsed_seed_dict(): 'database': 'test_db', 'schema': 'test_schema', 'alias': 'foo', - 'checksum': {'name': 'path', 'checksum': '/root/seeds/seed.csv'}, + 'checksum': {'name': 'path', 'checksum': 'seeds/seed.csv'}, }