Skip to content

Commit

Permalink
Add redshift specific coefficient return function
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Stevens authored and Chris Stevens committed Jun 14, 2024
1 parent 5b17c2d commit d418fd0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions macros/linear_regression/utils.sql
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ gb{{ loop.index }} as {{ gb }},
{% endif %}
{% endmacro %}

{% macro redshift___maybe_round(x, round_) %}
{% if round_ is not none %}
{{ return('round(' ~ x ~ ', ' ~ round_ ~ ')') }}
{% else %}
{{ return(x) }}
{% endif %}
{% endmacro %}

{# Alias and write group by columns in a standard way. #}
{% macro _gb_cols(group_by, trailing_comma=False, prefix=None) -%}
{%- if group_by %}
Expand Down

0 comments on commit d418fd0

Please sign in to comment.