Skip to content

Commit bfc629c

Browse files
committed
feat: allow anchoring yml paths to models base directory
1 parent 04f92c0 commit bfc629c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: Added
2+
body: Allow anchoring yml paths to the models base directory
3+
time: 2025-01-30T23:43:00.049818-07:00

src/dbt_osmosis/core/osmosis.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,9 @@ def get_target_yaml_path(context: YamlRefactorContext, node: ResultNode) -> Path
11341134

11351135
if node.resource_type == NodeType.Source:
11361136
segments.append(context.project.runtime_cfg.model_paths[0])
1137+
elif rendered.startswith("/"):
1138+
segments.append(context.project.runtime_cfg.model_paths[0])
1139+
rendered = rendered.lstrip("/")
11371140
else:
11381141
segments.append(Path(node.original_file_path).parent)
11391142

0 commit comments

Comments
 (0)