Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] group_by= doesn't work for >1 grouped variable #22

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading