From 35150f914feb492b5165073684facb4503f8bdaf Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Fri, 13 Aug 2021 10:57:57 -0400 Subject: [PATCH] Use is_relational check for schema caching (#3716) (#3737) * Use is_relational check for schema caching * Fix flake8 * Update changelog --- CHANGELOG.md | 1 + core/dbt/adapters/base/impl.py | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f14d6c932d2..00f43ebdec8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Fixes - Fix for RPC requests that raise a RecursionError when serializing Undefined values as JSON ([#3464](https://github.com/dbt-labs/dbt/issues/3464), [#3687](https://github.com/dbt-labs/dbt/pull/3687)) +- 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 - Add `build` RPC method, and a subset of flags for `build` task ([#3595](https://github.com/dbt-labs/dbt/issues/3595), [#3674](https://github.com/dbt-labs/dbt/pull/3674)) diff --git a/core/dbt/adapters/base/impl.py b/core/dbt/adapters/base/impl.py index 46491202f9c..1d9018446e5 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 ) }