Skip to content

Commit

Permalink
fix: check columns against columns() not strings (#27)
Browse files Browse the repository at this point in the history
## Description
- fixes a bug where the included columns were not being cast correctly
  • Loading branch information
tnightengale authored Apr 3, 2023
1 parent 41f8ab1 commit 99dec8c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Include in `packages.yml`:
```yaml
packages:
- package: tnightengale/dbt_activity_schema
version: 0.3.2
version: 0.3.3
```
For latest release, see
https://github.com/tnightengale/dbt-activity-schema/releases.
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Project name.
name: 'dbt_activity_schema'
version: '0.3.2'
version: '0.3.3'
config-version: 2
require-dbt-version: [">=1.3.0", "<2.0.0"]

Expand Down
10 changes: 5 additions & 5 deletions macros/utils/aggregations/_min_or_max.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

{% set aggregation = "min" if min_or_max == "min" else "max" %}
{% set column_name = qualified_col.split(".")[-1].strip() %}

{% set qualified_ts_col = "{}.{}".format(dbt_activity_schema.appended(), dbt_activity_schema.columns().ts )%}
{% set columns = dbt_activity_schema.columns() %}


{# Set type to cast back to after aggregation. #}
{# TODO: Refactor column abstraction to contain types. #}
{% if column_name in [
"ts",
"activity_repeated_at"
columns.ts,
columns.activity_repeated_at
] %}
{% set type = dbt.type_timestamp() %}
{% elif column_name in [
"activity_occurrence",
"revenue_impact"
columns.activity_occurrence,
columns.revenue_impact
] %}
{% set type = dbt.type_numeric() %}
{% else %}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dbt-activity-schema"
version = "0.3.2"
version = "0.3.3"
description = "A dbt package to create models within the Activity Schema data model framework."
authors = ["Teghan Nightengale <[email protected]>"]
license = "GNU"
Expand Down

0 comments on commit 99dec8c

Please sign in to comment.