Skip to content

Commit

Permalink
Merge pull request #22 from dwreeves/21-bugfix
Browse files Browse the repository at this point in the history
[Bugfix] `group_by=` doesn't work for >1 grouped variable
  • Loading branch information
dwreeves authored Oct 2, 2024
2 parents 854edbb + 263f991 commit 990d8b7
Show file tree
Hide file tree
Showing 5 changed files with 460 additions and 493 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### `0.2.6`

- Fix bug with `group_by` on multiple variables; contributed by [@svkohler](https://github.com/dwreeves/dbt_linreg/issues/21).

### `0.2.5`

- Fix bug where `exog` and `group_by` did not handle `str` inputs e.g. `exog="x"`.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Add this the `packages:` list your dbt project's `packages.yml`:

```yaml
- package: "dwreeves/dbt_linreg"
version: "0.2.5"
version: "0.2.6"
```
The full file will look something like this:
Expand All @@ -43,7 +43,7 @@ packages:
# Other packages here
# ...
- package: "dwreeves/dbt_linreg"
version: "0.2.5"
version: "0.2.6"
```
# Examples
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "dbt_linreg"
version: "0.2.5"
version: "0.2.6"

# 1.2 is required because of modules.itertools.
require-dbt-version: [">=1.2.0", "<2.0.0"]
Expand Down
2 changes: 1 addition & 1 deletion macros/linear_regression/utils/utils.sql
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ inner join {{ join_to }}
on
{%- for _ in group_by %}
{{ join_from }}.gb{{ loop.index }} = {{ join_to }}.gb{{ loop.index }}
{%- if not loop.last -%}
{% if not loop.last -%}
and
{%- endif %}
{%- endfor %}
Expand Down
Loading

0 comments on commit 990d8b7

Please sign in to comment.