Skip to content

Commit

Permalink
feat: allow anchoring yml paths to models base directory
Browse files Browse the repository at this point in the history
  • Loading branch information
z3z1ma committed Jan 31, 2025
1 parent 04f92c0 commit bfc629c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changes/unreleased/Added-20250130-234300.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Added
body: Allow anchoring yml paths to the models base directory
time: 2025-01-30T23:43:00.049818-07:00
3 changes: 3 additions & 0 deletions src/dbt_osmosis/core/osmosis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,9 @@ def get_target_yaml_path(context: YamlRefactorContext, node: ResultNode) -> Path

if node.resource_type == NodeType.Source:
segments.append(context.project.runtime_cfg.model_paths[0])
elif rendered.startswith("/"):
segments.append(context.project.runtime_cfg.model_paths[0])
rendered = rendered.lstrip("/")
else:
segments.append(Path(node.original_file_path).parent)

Expand Down

0 comments on commit bfc629c

Please sign in to comment.