Skip to content

Commit

Permalink
Merge pull request #18 from steelcd/main
Browse files Browse the repository at this point in the history
Add redshift specific coefficient return function
  • Loading branch information
dwreeves authored Jun 14, 2024
2 parents 5b17c2d + d418fd0 commit 45a8030
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 45a8030

Please sign in to comment.