From aa08ddc06eeaf8416fa9d82a3a5097e6ba666ba7 Mon Sep 17 00:00:00 2001 From: Niall Woodward Date: Fri, 5 Aug 2022 10:47:54 +0100 Subject: [PATCH] Handle windows file paths by escaping backslash --- macros/upload_exposures.sql | 2 +- macros/upload_models.sql | 2 +- macros/upload_seeds.sql | 2 +- macros/upload_snapshots.sql | 2 +- macros/upload_tests.sql | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/macros/upload_exposures.sql b/macros/upload_exposures.sql index cb34763b..c9bd2751 100644 --- a/macros/upload_exposures.sql +++ b/macros/upload_exposures.sql @@ -30,7 +30,7 @@ '{{ exposure.type }}', {# type #} '{{ tojson(exposure.owner) }}', {# owner #} '{{ exposure.maturity }}', {# maturity #} - '{{ exposure.original_file_path }}', {# path #} + '{{ exposure.original_file_path | replace('\\', '\\\\') }}', {# path #} '{{ exposure.description }}', {# description #} '{{ exposure.url }}', {# url #} '{{ exposure.package_name }}', {# package_name #} diff --git a/macros/upload_models.sql b/macros/upload_models.sql index 785b886f..9d7ddc1a 100644 --- a/macros/upload_models.sql +++ b/macros/upload_models.sql @@ -30,7 +30,7 @@ '{{ model.name }}', {# name #} '{{ tojson(model.depends_on.nodes) }}', {# depends_on_nodes #} '{{ model.package_name }}', {# package_name #} - '{{ model.original_file_path }}', {# path #} + '{{ model.original_file_path | replace('\\', '\\\\') }}', {# path #} '{{ model.checksum.checksum }}', {# checksum #} '{{ model.config.materialized }}' {# materialization #} ) diff --git a/macros/upload_seeds.sql b/macros/upload_seeds.sql index f20cf8c6..2f14a1b2 100644 --- a/macros/upload_seeds.sql +++ b/macros/upload_seeds.sql @@ -27,7 +27,7 @@ '{{ seed.schema }}', {# schema #} '{{ seed.name }}', {# name #} '{{ seed.package_name }}', {# package_name #} - '{{ seed.original_file_path }}', {# path #} + '{{ seed.original_file_path | replace('\\', '\\\\') }}', {# path #} '{{ seed.checksum.checksum }}' {# checksum #} ) {%- if not loop.last %},{%- endif %} diff --git a/macros/upload_snapshots.sql b/macros/upload_snapshots.sql index e6a755d6..613ef965 100644 --- a/macros/upload_snapshots.sql +++ b/macros/upload_snapshots.sql @@ -30,7 +30,7 @@ '{{ snapshot.name }}', {# name #} '{{ tojson(snapshot.depends_on.nodes) }}', {# depends_on_nodes #} '{{ snapshot.package_name }}', {# package_name #} - '{{ snapshot.original_file_path }}', {# path #} + '{{ snapshot.original_file_path | replace('\\', '\\\\') }}', {# path #} '{{ snapshot.checksum.checksum }}', {# checksum #} '{{ snapshot.config.strategy }}' {# strategy #} ) diff --git a/macros/upload_tests.sql b/macros/upload_tests.sql index 5acf4ba1..a62e213f 100644 --- a/macros/upload_tests.sql +++ b/macros/upload_tests.sql @@ -25,7 +25,7 @@ '{{ test.name }}', {# name #} '{{ tojson(test.depends_on.nodes) }}', {# depends_on_nodes #} '{{ test.package_name }}', {# package_name #} - '{{ test.original_file_path }}', {# test_path #} + '{{ test.original_file_path | replace('\\', '\\\\') }}', {# test_path #} '{{ tojson(test.tags) }}' {# tags #} ) {%- if not loop.last %},{%- endif %}