Skip to content

Commit

Permalink
Fix for Windows filepaths (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
LewisDavies authored Dec 18, 2023
1 parent 00d9852 commit fd78d86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion macros/ref.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
relations always have the same name as the model (+ version suffix when needed).
It's hacky but it seems to work.
***************/
{% set prod_rel_name = parent_node.path.split("/")[-1].replace(".sql", "") %}
{% set re = modules.re %}
{% set prod_rel_name = re.search("\w+(?=\.)", parent_node.path).group() %}
{% set prod_rel = adapter.get_relation(parent_database, parent_schema, prod_rel_name) %}
{% set dev_rel = load_relation(parent_ref) %}
{% set prod_exists = prod_rel is not none %}
Expand Down

0 comments on commit fd78d86

Please sign in to comment.