-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: * fix: change var to `override_columns` * feat: add export_env.sh, fix: models.yml test
- Loading branch information
1 parent
6b1f354
commit 090ca1d
Showing
16 changed files
with
138 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
integration_tests/models/first_after/dataset__first_after_3.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{ | ||
dbt_activity_schema.dataset( | ||
ref("input__first_after"), | ||
dbt_activity_schema.primary_activity("All","signed up"), | ||
[ | ||
dbt_activity_schema.append_activity( | ||
"first_after", | ||
"visit page", | ||
["feature_json", "activity_occurrence", "ts"], | ||
feature_json_join_columns=["type"] | ||
) | ||
] | ||
) | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
export $(grep -v '^#' .env | xargs) |
24 changes: 12 additions & 12 deletions
24
integration_tests/seeds/first_after/input__first_after.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
activity_id,ts,customer,activity,anonymous_customer_id,feature_json,revenue_impact,link,activity_occurrence,activity_repeated_at | ||
2,2022-01-01 22:10:11,1,visit page,,"[{""visited page"": 1}]",0,,1,2022-01-03 22:10:11 | ||
3,2022-01-02 22:10:11,1,signed up,,"[{""signed up"": 1}]",0,,1, | ||
4,2022-01-03 22:10:11,1,visit page,,"[{""visited page"": 1}]",0,,2,2022-01-04 22:10:11 | ||
5,2022-01-04 22:10:11,1,visit page,,"[{""visited page"": 1}]",0,,3,2022-01-06 22:10:11 | ||
6,2022-01-05 22:10:11,1,bought something,,"[{""bought something"": 1}]",100,,1, | ||
7,2022-01-06 22:10:11,1,visit page,,"[{""visited page"": 1}]",0,,4, | ||
8,2022-01-07 22:10:11,7,visit page,,"[{""visited page"": 1}]",0,,1,2022-01-09 22:10:11 | ||
9,2022-01-08 22:10:11,7,signed up,,"[{""signed up"": 1}]",0,,1, | ||
10,2022-01-09 22:10:11,7,visit page,,"[{""visited page"": 1}]",0,,2,2022-01-10 22:10:11 | ||
11,2022-01-10 22:10:11,7,visit page,,"[{""visited page"": 1}]",0,,3,2022-01-12 22:10:11 | ||
12,2022-01-11 22:10:11,7,bought something,,"[{""bought something"": 1}]",100,,1, | ||
13,2022-01-12 22:10:11,7,visit page,,"[{""visited page"": 1}]",0,,4, | ||
2,2022-01-01 22:10:11,1,visit page,,"{""type"": 1}",0,,1,2022-01-03 22:10:11 | ||
3,2022-01-02 22:10:11,1,signed up,,"{""type"": 1}",0,,1, | ||
4,2022-01-03 22:10:11,1,visit page,,"{""type"": 2}",0,,2,2022-01-04 22:10:11 | ||
5,2022-01-04 22:10:11,1,visit page,,"{""type"": 2}",0,,3,2022-01-06 22:10:11 | ||
6,2022-01-05 22:10:11,1,bought something,,"{""type"": 1}",100,,1, | ||
7,2022-01-06 22:10:11,1,visit page,,"{""type"": 1}",0,,4, | ||
8,2022-01-07 22:10:11,7,visit page,,"{""type"": 1}",0,,1,2022-01-09 22:10:11 | ||
9,2022-01-08 22:10:11,7,signed up,,"{""type"": 1}",0,,1, | ||
10,2022-01-09 22:10:11,7,visit page,,"{""type"": 2}",0,,2,2022-01-10 22:10:11 | ||
11,2022-01-10 22:10:11,7,visit page,,"{""type"": 2}",0,,3,2022-01-12 22:10:11 | ||
12,2022-01-11 22:10:11,7,bought something,,"{""type"": 1}",100,,1, | ||
13,2022-01-12 22:10:11,7,visit page,,"{""type"": 1}",0,,4, |
4 changes: 2 additions & 2 deletions
4
integration_tests/seeds/first_after/output/output__first_after_1.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
ACTIVITY_ID,CUSTOMER,TS,ACTIVITY,ANONYMOUS_CUSTOMER_ID,FEATURE_JSON,REVENUE_IMPACT,LINK,ACTIVITY_OCCURRENCE,ACTIVITY_REPEATED_AT,FIRST_AFTER_BOUGHT_SOMETHING_FEATURE_JSON,FIRST_AFTER_BOUGHT_SOMETHING_TS | ||
3,1,2022-01-02 22:10:11.000,signed up,,[{"signed up": 1}],0,,1,,[{"bought something": 1}],2022-01-05 22:10:11.000 | ||
9,7,2022-01-08 22:10:11.000,signed up,,[{"signed up": 1}],0,,1,,[{"bought something": 1}],2022-01-11 22:10:11.000 | ||
3,1,2022-01-02 22:10:11.000,signed up,,{"type": 1},0,,1,,{"type": 1},2022-01-05 22:10:11.000 | ||
9,7,2022-01-08 22:10:11.000,signed up,,{"type": 1},0,,1,,{"type": 1},2022-01-11 22:10:11.000 |
16 changes: 8 additions & 8 deletions
16
integration_tests/seeds/first_after/output/output__first_after_2.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
ACTIVITY_ID,CUSTOMER,TS,ACTIVITY,ANONYMOUS_CUSTOMER_ID,FEATURE_JSON,REVENUE_IMPACT,LINK,ACTIVITY_OCCURRENCE,ACTIVITY_REPEATED_AT,FIRST_AFTER_BOUGHT_SOMETHING_FEATURE_JSON,FIRST_AFTER_BOUGHT_SOMETHING_TS | ||
8,7,2022-01-07 22:10:11.000,visit page,,[{"visited page": 1}],0,,1,2022-01-09 22:10:11.000,, | ||
11,7,2022-01-10 22:10:11.000,visit page,,[{"visited page": 1}],0,,3,2022-01-12 22:10:11.000,[{"bought something": 1}],2022-01-11 22:10:11.000 | ||
2,1,2022-01-01 22:10:11.000,visit page,,[{"visited page": 1}],0,,1,2022-01-03 22:10:11.000,, | ||
10,7,2022-01-09 22:10:11.000,visit page,,[{"visited page": 1}],0,,2,2022-01-10 22:10:11.000,, | ||
5,1,2022-01-04 22:10:11.000,visit page,,[{"visited page": 1}],0,,3,2022-01-06 22:10:11.000,[{"bought something": 1}],2022-01-05 22:10:11.000 | ||
4,1,2022-01-03 22:10:11.000,visit page,,[{"visited page": 1}],0,,2,2022-01-04 22:10:11.000,, | ||
7,1,2022-01-06 22:10:11.000,visit page,,[{"visited page": 1}],0,,4,,, | ||
13,7,2022-01-12 22:10:11.000,visit page,,[{"visited page": 1}],0,,4,,, | ||
7,1,2022-01-06 22:10:11.000,visit page,,{"type": 1},0,,4,,, | ||
2,1,2022-01-01 22:10:11.000,visit page,,{"type": 1},0,,1,2022-01-03 22:10:11.000,, | ||
4,1,2022-01-03 22:10:11.000,visit page,,{"type": 2},0,,2,2022-01-04 22:10:11.000,, | ||
10,7,2022-01-09 22:10:11.000,visit page,,{"type": 2},0,,2,2022-01-10 22:10:11.000,, | ||
8,7,2022-01-07 22:10:11.000,visit page,,{"type": 1},0,,1,2022-01-09 22:10:11.000,, | ||
5,1,2022-01-04 22:10:11.000,visit page,,{"type": 2},0,,3,2022-01-06 22:10:11.000,{"type": 1},2022-01-05 22:10:11.000 | ||
11,7,2022-01-10 22:10:11.000,visit page,,{"type": 2},0,,3,2022-01-12 22:10:11.000,{"type": 1},2022-01-11 22:10:11.000 | ||
13,7,2022-01-12 22:10:11.000,visit page,,{"type": 1},0,,4,,, |
3 changes: 3 additions & 0 deletions
3
integration_tests/seeds/first_after/output/output__first_after_3.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ACTIVITY_ID,CUSTOMER,TS,ACTIVITY,ANONYMOUS_CUSTOMER_ID,FEATURE_JSON,REVENUE_IMPACT,LINK,ACTIVITY_OCCURRENCE,ACTIVITY_REPEATED_AT,FIRST_AFTER_VISIT_PAGE_FEATURE_JSON,FIRST_AFTER_VISIT_PAGE_ACTIVITY_OCCURRENCE,FIRST_AFTER_VISIT_PAGE_TS | ||
3,1,2022-01-02 22:10:11.000,signed up,,{"type": 1},0,,1,,{"type": 1},4,2022-01-06 22:10:11.000 | ||
9,7,2022-01-08 22:10:11.000,signed up,,{"type": 1},0,,1,,{"type": 1},4,2022-01-12 22:10:11.000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% macro json_unpack_key(json_col, key) %} | ||
{{ return(adapter.dispatch("json_unpack_key", "dbt_activity_schema")(json_col, key))}} | ||
{% endmacro %} | ||
|
||
{# params | ||
|
||
key: str | ||
The name of the key to unpack from the activity schema feature_json column. | ||
#} | ||
|
||
{% macro default__json_unpack_key(json_col, key) -%} | ||
|
||
{% if caller %} | ||
|
||
json_extract_path_text({{ caller }}) | ||
|
||
{% else %} | ||
|
||
json_extract_path_text({{ json_col }}, {{dbt.string_literal(key) }}) | ||
|
||
{% endif %} | ||
|
||
{%- endmacro %} |