From 566793449c5b70991c48975c669051c06e9f704c Mon Sep 17 00:00:00 2001 From: Simon Baudoin Date: Mon, 3 Feb 2025 16:18:37 +0100 Subject: [PATCH] fix issue with yaml not existing --- src/dbt_osmosis/core/osmosis.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dbt_osmosis/core/osmosis.py b/src/dbt_osmosis/core/osmosis.py index e22e8a6..37bd1cd 100644 --- a/src/dbt_osmosis/core/osmosis.py +++ b/src/dbt_osmosis/core/osmosis.py @@ -665,9 +665,9 @@ def _is_fqn_match(node: ResultNode, fqns: list[str]) -> bool: def _is_file_match(node: ResultNode, paths: list[Path | str], root: Path | str) -> bool: """Check if a node's file path matches any of the provided file paths or names.""" node_path = Path(root, node.original_file_path).resolve() - yaml_path = None if node.patch_path: - yaml_path = Path(root, node.patch_path.partition("://")[-1]).resolve() + absolute_patch_path = Path(root, node.patch_path.partition("://")[-1]).resolve() + yaml_path = absolute_patch_path if absolute_patch_path.exists() else None for model_or_dir in paths: model_or_dir = Path(model_or_dir).resolve() if node.name == model_or_dir.stem: