Skip to content

Commit 77ba63d

Browse files
authored
Merge pull request #68 from fishtown-analytics/faster-unions
short circuit parsing for introspective macros
2 parents 69490e2 + 1793e06 commit 77ba63d

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

macros/schema_tests/equality.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{% macro test_equality(model, arg) %}
22

33

4+
{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}
5+
{%- if not execute -%}
6+
{{ return('') }}
7+
{% endif %}
48

59
-- setup
610

macros/sql/star.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{% macro star(from, except=[]) -%}
22

3+
{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}
4+
{%- if not execute -%}
5+
{{ return('') }}
6+
{% endif %}
7+
38
{%- if from.name -%}
49
{%- set schema_name, table_name = from.schema, from.name -%}
510
{%- else -%}

macros/sql/union.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{% macro union_tables(tables, column_override=none, exclude=none) -%}
22

3+
{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}
4+
{%- if not execute -%}
5+
{{ return('') }}
6+
{% endif %}
7+
38
{%- set exclude = exclude if exclude is not none else [] %}
49
{%- set column_override = column_override if column_override is not none else {} %}
510

0 commit comments

Comments
 (0)