Skip to content

Commit e658825

Browse files
sdebruynclaude
andcommitted
Move quote_identifier and bool_literal to own files
Generic dispatch macros belong in their own files (like type_string.sql), not in fabric_shims.sql which is only for Fabric-specific overrides. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a28b39b commit e658825

3 files changed

Lines changed: 15 additions & 17 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{# Convert a Python boolean to a SQL boolean literal appropriate for the target adapter #}
2+
{% macro bool_literal(value) %}
3+
{{ return(adapter.dispatch('bool_literal', 'dbt_project_evaluator')(value)) }}
4+
{% endmacro %}
5+
6+
{% macro default__bool_literal(value) %}{{ value | trim }}{% endmacro %}
7+
8+
{% macro fabric__bool_literal(value) %}{% if value %}1{% else %}0{% endif %}{% endmacro %}
Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
11
{% macro fabric__escape_single_quotes(expression) -%}
22
{{ expression | replace("'","''") }}
33
{%- endmacro %}
4-
5-
{% macro quote_identifier(name) %}
6-
{{ return(adapter.dispatch('quote_identifier', 'dbt_project_evaluator')(name)) }}
7-
{% endmacro %}
8-
9-
{% macro default__quote_identifier(name) %}{{ name }}{% endmacro %}
10-
11-
{% macro fabric__quote_identifier(name) %}[{{ name }}]{% endmacro %}
12-
13-
{# Convert a Python boolean to a SQL boolean literal appropriate for the target adapter #}
14-
{% macro bool_literal(value) %}
15-
{{ return(adapter.dispatch('bool_literal', 'dbt_project_evaluator')(value)) }}
16-
{% endmacro %}
17-
18-
{% macro default__bool_literal(value) %}{{ value | trim }}{% endmacro %}
19-
20-
{% macro fabric__bool_literal(value) %}{% if value %}1{% else %}0{% endif %}{% endmacro %}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% macro quote_identifier(name) %}
2+
{{ return(adapter.dispatch('quote_identifier', 'dbt_project_evaluator')(name)) }}
3+
{% endmacro %}
4+
5+
{% macro default__quote_identifier(name) %}{{ name }}{% endmacro %}
6+
7+
{% macro fabric__quote_identifier(name) %}[{{ name }}]{% endmacro %}

0 commit comments

Comments
 (0)