From 3cd871155358092b9fac532e1cba0da7c4be894a Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Thu, 26 Aug 2021 11:03:45 +0200 Subject: [PATCH] Use is_relational check for schema caching (#3716) (#3809) * Use is_relational check for schema caching * Fix flake8 * Update changelog --- CHANGELOG.md | 3 +++ core/dbt/adapters/base/impl.py | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc5f52e1d9d..d2c4028436a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## dbt 0.20.2 (Release TBD) +### Fixes +- Avoid caching schemas for tests when `store_failures` is not enabled ([#3715](https://github.com/dbt-labs/dbt/issues/3715), [#3716](https://github.com/dbt-labs/dbt/pull/3716)) + ### Under the hood - Get more information on partial parsing version mismatches ([#3757](https://github.com/dbt-labs/dbt/issues/3757), [#3758](https://github.com/dbt-labs/dbt/pull/3758)) - Use GitHub Actions for CI ([#3688](https://github.com/dbt-labs/dbt/issues/3688), [#3669](https://github.com/dbt-labs/dbt/pull/3669)) diff --git a/core/dbt/adapters/base/impl.py b/core/dbt/adapters/base/impl.py index 69dd0d3b12d..411f4ba7d6d 100644 --- a/core/dbt/adapters/base/impl.py +++ b/core/dbt/adapters/base/impl.py @@ -31,7 +31,6 @@ from dbt.contracts.graph.manifest import Manifest, MacroManifest from dbt.contracts.graph.parsed import ParsedSeedNode from dbt.exceptions import warn_or_error -from dbt.node_types import NodeType from dbt.logger import GLOBAL_LOGGER as logger from dbt.utils import filter_null_values, executor @@ -310,8 +309,7 @@ def _get_cache_schemas(self, manifest: Manifest) -> Set[BaseRelation]: self.Relation.create_from(self.config, node).without_identifier() for node in manifest.nodes.values() if ( - node.resource_type in NodeType.executable() and - not node.is_ephemeral_model + node.is_relational and not node.is_ephemeral_model ) }