Skip to content

Commit

Permalink
Update generate_translated_table.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
obanda authored Apr 17, 2023
1 parent 49f762e commit 3e60e5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions macros/generate_translated_table.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% macro generate_translated_table(rawtable, labelstable, language = 'und') %}
{% macro generate_translated_table(rawtable, labelstable, language) %}
--language is 'und' when multiple languages do not exist

{%- set fieldlist = dbt_utils.get_filtered_columns_in_relation(rawtable) -%}
{%- set optionslist = dbt_utils.get_column_values(labelstable, column='option') |list %}
Expand All @@ -21,4 +22,4 @@ left join {{labelstable}} as t{{optionslist.index(option)}} on t{{optionslist.i
and r.{{option}}::varchar = t{{optionslist.index(option)}}.label and t{{optionslist.index(option)}}.language = '{{language}}'
{%- endfor %}

{% endmacro %}
{% endmacro %}

0 comments on commit 3e60e5b

Please sign in to comment.