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

merge pull request #39

Open
wants to merge 111 commits into
base: clean-up-contributions
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
2415521
add basic trello models
Feb 25, 2016
c98e066
move datatype coersions and field renaming
Feb 25, 2016
d89fb46
test fixes
Feb 25, 2016
cd84456
Merge branch 'master' into feature/trello
jthandy Mar 1, 2016
ff29b89
remove trello boilerplate, add card_location model
Mar 5, 2016
bee418c
Merge branch 'feature/trello' of github.com:analyst-collective/models…
Mar 5, 2016
9045346
fix whitespace
Mar 5, 2016
9c8d17c
Merge branch 'interface-investigation' into feature/trello
Mar 5, 2016
fba2613
trello card location model
Mar 5, 2016
72c51f4
use commentCard actions for location updates
Mar 5, 2016
1314047
change trello test namespace
Mar 5, 2016
251f415
add trello model tests and have runner handle all .sql files
Mar 5, 2016
6927f01
basic email interface model for pardot
jthandy Mar 8, 2016
1490bfd
Merge pull request #13 from analyst-collective/clean-up-contributions
Mar 8, 2016
11b77fe
Merge branch 'master' into feature/trello
Mar 9, 2016
12de9d2
Merge pull request #14 from analyst-collective/feature/trello
Mar 9, 2016
3c7f282
lots of work on email analysis
jthandy Mar 9, 2016
8f95341
Merge branch 'master' into interface/email
jthandy Mar 9, 2016
f754016
Updated email analysis.
jthandy Mar 9, 2016
ccdacc8
drop and create schema in first step of runner
Mar 10, 2016
fa1afd9
throw error if schema already exists
Mar 11, 2016
3c210a9
Merge pull request #15 from analyst-collective/drop-create-schema
Mar 11, 2016
fd5d6be
ignore config
jthandy Mar 15, 2016
9651caf
Merge pull request #18 from analyst-collective/interface/email
Mar 16, 2016
98445a3
zuora models v1
Mar 16, 2016
958fdd2
zuora models v1
Mar 16, 2016
eafbbb0
zuora models v1
Mar 16, 2016
97d3ea2
zuora v2
Mar 16, 2016
2901e7f
updates for all files to use dbt syntax
jthandy Mar 16, 2016
559dc02
remove old shit
jthandy Mar 17, 2016
09e7cca
Merge branch 'remove-old-shit' into models/stripe
jthandy Mar 17, 2016
96dedda
Merge pull request #21 from analyst-collective/remove-old-shit
Mar 17, 2016
4d9017d
initial stripe model and analysis
jthandy Mar 17, 2016
2cdc0c8
minor changes to update plans
jthandy Mar 17, 2016
7fc4ab0
Merge branch 'master' of github.com:analyst-collective/models
Mar 17, 2016
1956334
zuora v1
Mar 17, 2016
a54b7d3
zuora v1
Mar 17, 2016
b36f605
zuora v1
Mar 17, 2016
aaa2248
Merge pull request #19 from 3mei/master
Mar 17, 2016
e4e2769
Merge remote-tracking branch 'origin/master'
jthandy Mar 17, 2016
c9b8c19
Magento Hello World.
mattmonihan Mar 18, 2016
a21d445
clean up
jthandy Mar 19, 2016
70dcf7e
update dbt project to reference correct models dir
jthandy Mar 19, 2016
1046a21
Renamed column references and changed schema from 'magento' to 'sampl…
mattmonihan Mar 20, 2016
2b1006b
Adjusted analysis query for magento. Got it running successfully.
mattmonihan Mar 20, 2016
fe770d5
Merge pull request #25 from mattmonihan/magento_analysis
Mar 21, 2016
c1548c7
lots of stripe debugging
jthandy Mar 21, 2016
a4b10c1
updates to analysis
jthandy Mar 22, 2016
7b613d3
Merge pull request #27 from analyst-collective/spring-cleaning
Mar 22, 2016
55f3600
changes after stripe code review
jthandy Mar 22, 2016
62fa124
small updates to analytical query
jthandy Mar 22, 2016
fc9b2ec
major refactor of stripe analysis in response to comments in PR
jthandy Mar 23, 2016
b662986
more stripe changes
jthandy Mar 24, 2016
8b19da9
fix renewal calc
jthandy Mar 24, 2016
077dd7d
moved magento models to correct folder
jthandy Mar 24, 2016
e60b8da
split out pardot models
Mar 25, 2016
5ee44df
add new pardot files
Mar 25, 2016
847bb21
fix pardot defs and split out magento models
Mar 25, 2016
4499b0d
split out emails
Mar 25, 2016
39f4ad8
split out snowplow and segment
Mar 25, 2016
8c8aad2
split out trello model
Mar 25, 2016
3caf061
restructure trello tests
Mar 25, 2016
a43a8a4
split out zuora models
Mar 25, 2016
7c799d8
update dbt project file
Mar 25, 2016
e6dff22
updates based on code review
jthandy Mar 25, 2016
677e586
final CR comments addressed
jthandy Mar 25, 2016
7caf174
Merge pull request #28 from analyst-collective/models/stripe
Mar 25, 2016
2b3ca79
update configs to render to table
Mar 28, 2016
7e52da5
Create License.md
Mar 29, 2016
b81947a
change emails to pardot_emails (for now)
Mar 29, 2016
fa314ee
move stripe models folder
jthandy Mar 29, 2016
18af13e
Merge branch 'master' into one-model-per-file
Mar 29, 2016
f3fef6a
fix master merge (model --> models)
Mar 29, 2016
934c6b2
delete model directory
Mar 29, 2016
dda5bff
dedent stripe code
Mar 29, 2016
ded33b2
specify model and table_or_view in config
Mar 29, 2016
d97835a
add back in test path
Mar 29, 2016
a005f2c
mixpanel v1
Mar 30, 2016
df8ece5
mixpanel v1
Mar 30, 2016
0c75a6a
added retention analysis
Mar 31, 2016
5128e03
* changes
Apr 1, 2016
1c3e80a
added event cohorts
Apr 1, 2016
b496e6d
Merge pull request #29 from analyst-collective/one-model-per-file
drewbanin Apr 3, 2016
7e5e431
remove old configs
Apr 3, 2016
b76a144
update example configs
Apr 3, 2016
5b14dbd
Merge branch 'master' of github.com:analyst-collective/models
Apr 4, 2016
598cd6b
updates to readme based on current workflow
jthandy Apr 5, 2016
3bb3fdf
Merge pull request #31 from analyst-collective/readme-v0.2
Apr 5, 2016
6c2a2c3
updated mixpanel models
Apr 5, 2016
305e67b
mailchimp v1
Apr 6, 2016
6adcd87
removed mixpanel from the mailchimp branch
Apr 6, 2016
3e623c7
added base models for every action and added gains and losses
Apr 8, 2016
97db355
updated gains_losses
Apr 11, 2016
4f10835
Merge pull request #33 from 3mei/mailchimp
Apr 11, 2016
ec70d01
updates to mailchimp analysis for blog post
jthandy Apr 14, 2016
0ff459c
updates based on pr
jthandy Apr 15, 2016
6e96fa5
spacing!
jthandy Apr 15, 2016
78a51da
Merge pull request #35 from analyst-collective/mailchimp-updates
Apr 15, 2016
3af6b34
don't explicity reference env.schema in model defs
May 3, 2016
0f2ca78
replace calls to load() with ref()
May 3, 2016
8ab283a
add package namespace
May 5, 2016
7d09716
make version a string
May 5, 2016
1c945f6
make name and version top-level
May 6, 2016
90eee62
Merge pull request #36 from analyst-collective/feature/namespaced-ref…
drewbanin May 6, 2016
dc67d37
moved all of these to their own individual repos
jthandy Jun 30, 2016
bcbf61a
clean up old code
jthandy Aug 1, 2016
0f9d14f
clean up old code
jthandy Aug 1, 2016
6ab9779
updated to reflect the new purpose of this repo
jthandy Aug 1, 2016
69ee6aa
reflect deprecation
jthandy Aug 1, 2016
b72a3bc
.
jthandy Aug 1, 2016
a5a8c8e
update readme to include new stripe repo
jthandy Sep 23, 2016
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
Prev Previous commit
Next Next commit
replace calls to load() with ref()
  • Loading branch information
Drew Banin committed May 3, 2016
commit 0f2ca78f89791717862b770b20d27059decf48bf
2 changes: 1 addition & 1 deletion models/email/emails_denormalized.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
with events as (

select * from {{load('pardot_emails')}}
select * from {{ref('pardot_emails')}}

),

Expand Down
12 changes: 6 additions & 6 deletions models/mailchimp/mailchimp_all_events.sql
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
with
sends as (
select campaign_id, email_id, 'sent' as event_action, sent_date as event_date
from {{load('mailchimp_sends')}}
from {{ref('mailchimp_sends')}}
),

soft_bounces as (
select campaign_id, email_id, 'soft bounce' as event_action, bounced_date as event_date
from {{load('mailchimp_bounces')}}
from {{ref('mailchimp_bounces')}}
where bounce_type = 'soft'
),

hard_bounces as (
select campaign_id, email_id, 'hard bounce' as event_action, bounced_date as event_date
from {{load('mailchimp_bounces')}}
from {{ref('mailchimp_bounces')}}
where bounce_type = 'hard'
),

opens as (
select campaign_id, email_id, 'opened' as event_action, opened_date as event_date
from {{load('mailchimp_opens')}}
from {{ref('mailchimp_opens')}}
),

clicks as (
select campaign_id, email_id, 'clicked' as event_action, clicked_date as event_date
from {{load('mailchimp_clicks')}}
from {{ref('mailchimp_clicks')}}
),

unsubscribes as (
select campaign_id, email_id, 'unsubscribed' as event_action, unsubscribed_date as event_date
from {{load('mailchimp_unsubscribes')}}
from {{ref('mailchimp_unsubscribes')}}
)

select *
Expand Down
4 changes: 2 additions & 2 deletions models/mailchimp/mailchimp_bounces.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
select a.campaign_id, a.email_id, action_date as bounced_date, status as bounce_type
from {{load('mailchimp_email_actions')}} a
inner join {{load('mailchimp_sent_to')}} b
from {{ref('mailchimp_email_actions')}} a
inner join {{ref('mailchimp_sent_to')}} b
on a.campaign_id = b.campaign_id
and a.email_id = b.email_id
where action = 'bounce'
2 changes: 1 addition & 1 deletion models/mailchimp/mailchimp_clicks.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
select campaign_id, email_id, action_date as clicked_date
from {{load('mailchimp_email_actions')}}
from {{ref('mailchimp_email_actions')}}
where action = 'click'
10 changes: 5 additions & 5 deletions models/mailchimp/mailchimp_email_summary.sql
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
with
sends as (
select campaign_id, email_id, sent_date
from {{load('mailchimp_sends')}}
from {{ref('mailchimp_sends')}}
),

hard_bounces as (
select campaign_id, email_id, min(bounced_date) as hard_bounced_date
from {{load('mailchimp_bounces')}}
from {{ref('mailchimp_bounces')}}
where bounce_type = 'hard'
group by campaign_id, email_id
),
Expand All @@ -15,21 +15,21 @@ opens as (
select
campaign_id, email_id, min(opened_date) as first_opened_date,
max(opened_date) as last_opened_date, count(*) as total_opens
from {{load('mailchimp_opens')}}
from {{ref('mailchimp_opens')}}
group by campaign_id, email_id
),

clicks as (
select
campaign_id, email_id, min(clicked_date) as first_clicked_date,
max(clicked_date) as last_clicked_date, count(*) as total_clicks
from {{load('mailchimp_clicks')}}
from {{ref('mailchimp_clicks')}}
group by campaign_id, email_id
),

unsubscribes as (
select campaign_id, email_id, unsubscribed_date
from {{load('mailchimp_unsubscribes')}}
from {{ref('mailchimp_unsubscribes')}}
)

select
Expand Down
2 changes: 1 addition & 1 deletion models/mailchimp/mailchimp_opens.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
select campaign_id, email_id, action_date as opened_date
from {{load('mailchimp_email_actions')}}
from {{ref('mailchimp_email_actions')}}
where action = 'open'
4 changes: 2 additions & 2 deletions models/mailchimp/mailchimp_sends.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
select a.campaign_id, a.email_id, sent_date
from {{load('mailchimp_sent_to')}} a
from {{ref('mailchimp_sent_to')}} a
-- add information about when the campaign was sent
inner join {{load('mailchimp_campaigns')}} b
inner join {{ref('mailchimp_campaigns')}} b
on a.campaign_id = b.campaign_id
and a.list_id = b.list_id
2 changes: 1 addition & 1 deletion models/pardot/pardot_emails.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ data necessary to conform to the extended interface.
*/

select "@timestamp", "@event", "@user_id", email_id as "@email_id", details as "@subject"
from {{load('pardot_visitoractivity')}}
from {{ref('pardot_visitoractivity')}}
where "@event" in ('email sent', 'email opened', 'email click')
2 changes: 1 addition & 1 deletion models/pardot/pardot_tests.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ select
'visitoractivity_fresher_than_one_day' as name,
'Most recent visitoractivity entry is no more than one day old' as description,
max("@timestamp"::timestamp) > current_date - '1 day'::interval as result
from {{load('pardot_visitoractivity')}}
from {{ref('pardot_visitoractivity')}}



Expand Down
4 changes: 2 additions & 2 deletions models/pardot/pardot_visitoractivity.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ select
va.*
from
olga_pardot.visitoractivity va
inner join {{load('pardot_visitoractivity_events_meta')}} e
inner join {{ref('pardot_visitoractivity_events_meta')}} e
on va."type" = e."type" and va.type_name = e.type_name
inner join {{load('pardot_visitoractivity_types_meta')}} t
inner join {{ref('pardot_visitoractivity_types_meta')}} t
on va."type" = t."type"
2 changes: 1 addition & 1 deletion models/stripe/stripe_invoices_cleaned.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ select
timestamp 'epoch' + period_start * interval '1 Second' as period_start,
timestamp 'epoch' + period_end * interval '1 Second' as period_end
from
{{load('stripe_invoices')}}
{{ref('stripe_invoices')}}


6 changes: 3 additions & 3 deletions models/stripe/stripe_invoices_transformed.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
with invoices as (

select *
from {{load('stripe_invoices_cleaned')}}
from {{ref('stripe_invoices_cleaned')}}
where paid is true
and forgiven is false

Expand Down Expand Up @@ -55,7 +55,7 @@ from customer_dates d
on d.date_month >= date_trunc('month', i.period_start)
and d.date_month < date_trunc('month', i.period_end)
and d.customer = i.customer
left outer join {{load('stripe_subscriptions')}} s on i.subscription_id = s.id
left outer join {{load('stripe_plans')}} p on s.plan_id = p.id
left outer join {{ref('stripe_subscriptions')}} s on i.subscription_id = s.id
left outer join {{ref('stripe_plans')}} p on s.plan_id = p.id


4 changes: 2 additions & 2 deletions models/trello/trello_model_tests.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
with null_boards_or_lists as
(
select id
from {{load('trello_card_location')}}
from {{ref('trello_card_location')}}
where
data__board__id is null
or data__list__id is null
Expand All @@ -18,4 +18,4 @@ select
'fresher_than_one_day',
'Most recent entry is no more than one day old',
max(date::timestamp) > current_date - '1 day'::interval
from {{load('trello_card_location')}}
from {{ref('trello_card_location')}}
10 changes: 5 additions & 5 deletions models/zuora/zuora_subscriptions_w_charges_and_amendments.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ with subscr_w_amendments as
account_number, acc.account_id, sub.subscr_id,
subscr_name, subscr_status, subscr_term_type,
subscr_start, subscr_end, subscr_version, amend_id, amend_start
from {{load('zuora_account')}} acc
inner join {{load('zuora_subscription')}} sub
from {{ref('zuora_account')}} acc
inner join {{ref('zuora_subscription')}} sub
on acc.account_id = sub.account_id
-- add ammendments
left outer join {{load('zuora_amendment')}} amend
left outer join {{ref('zuora_amendment')}} amend
on sub.subscr_id = amend.subscr_id
)

Expand All @@ -21,7 +21,7 @@ select
min(subscr_start) over() as first_subscr,
"@mrr" as mrr
from subscr_w_amendments sub
inner join {{load('zuora_rate_plan')}} rp
inner join {{ref('zuora_rate_plan')}} rp
on rp.subscr_id = sub.subscr_id
inner join {{load('zuora_rate_plan_charge')}} rpc
inner join {{ref('zuora_rate_plan_charge')}} rpc
on rpc.rate_plan_id = rp.rate_plan_id