Skip to content

Commit

Permalink
Merge pull request #12 from bcodell/hotfixes-multiple
Browse files Browse the repository at this point in the history
Hotfixes multiple
  • Loading branch information
bcodell authored May 24, 2023
2 parents 83ef20a + c21ec5f commit ee5817e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion macros/activity_schema/dataset/aggregations/_helpers.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro _listagg_delimiter() %}
{%- do return("\n") -%}
{%- do return(dbt.string_literal("\n")) -%}
{% endmacro %}

{% macro type_boolean() %}
Expand Down
2 changes: 1 addition & 1 deletion macros/activity_schema/dataset/aggregations/listagg.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
{% endmacro %}

{% macro default__aggfunc_listagg(column) %}
listagg({{ column.column_sql }}, _listagg_delimiter())
listagg({{ column.column_sql }}, {{dbt_aql._listagg_delimiter()}})
{% endmacro %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
{% endmacro %}

{% macro default__aggfunc_listagg_distinct(column) %}
listagg(distinct {{ column.column_sql }}, _listagg_delimiter())
listagg(distinct {{ column.column_sql }}, {{dbt_aql._listagg_delimiter()}})
{% endmacro %}
9 changes: 5 additions & 4 deletions macros/activity_schema/dataset/dataset.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,20 @@
{%- set model_prefix = dbt_aql.get_model_prefix(stream) -%}

{% for ic in included_columns %}
{%- set ic_activity = dbt_aql._build_activity_from_dataset_column(stream, ic) -%}
{%- set ic_activity = dbt_aql._build_activity_from_dataset_column(stream, ic.strip()) -%}
{%- if ic_activity is not none -%}
{%- do joined_activities.append(ic_activity) -%}
{%- endif -%}
{% endfor %}

-- depends_on: {{ ref(stream) }}
{% for ic in included_columns %}
{% if modules.re.search(model_prefix, ic) is none %}
{% set m = model_prefix~ic %}
{% set ic_stripped = ic.strip() %}
{% if modules.re.search(model_prefix, ic_stripped) is none %}
{% set m = model_prefix~ic_stripped %}
-- depends_on: {{ ref(m) }}
{% else %}
-- depends_on: {{ ref(ic) }}
-- depends_on: {{ ref(ic_stripped) }}
{% endif %}
{% endfor %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{%- endif -%}

{%- set activity_node = graph.get("nodes", {}).get("model."~project_name~"."~dataset_column, {}) -%}
{%- set aql = activity_node.config.get("aql", none) -%}
{%- set aql = activity_node.get("config", {}).get("aql", none) -%}
{%- if aql is none -%}
{%- set error_message -%}
Dataset column model '{{dataset_column}}' does not have a required config key called `aql`.
Expand Down

0 comments on commit ee5817e

Please sign in to comment.