From fbfa25c939c75daba1da15ac8e08d3e89f724274 Mon Sep 17 00:00:00 2001 From: karthikkarnam Date: Thu, 7 May 2026 16:19:18 +1000 Subject: [PATCH] fix: only patch ref protection when a dbt-loom config is present When dbt-loom is installed as a transitive dependency and no dbt_loom.config.yml exists, the plugin still patchedis_invalid_private_ref / is_invalid_protected_ref with shims that are more permissive than dbt's originals. This silently suppressed Z002 dbt-loom installed surfaced the error. Guard the patch on self.config is not None so dbt's built-in enforcement is preserved when loom isn't actually being used. Closes #173 --- dbt_loom/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbt_loom/__init__.py b/dbt_loom/__init__.py index 2746832..1821237 100644 --- a/dbt_loom/__init__.py +++ b/dbt_loom/__init__.py @@ -131,7 +131,8 @@ def __init__(self, project_name: str): self.config: Optional[dbtLoomConfig] = self.read_config(configuration_path) self.models: Dict[str, LoomModelNodeArgs] = {} - self._patch_ref_protection() + if self.config is not None: + self._patch_ref_protection() if not self.config or (self.config and not self.config.enable_telemetry): self._patch_plugin_telemetry()