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 all commits
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
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@

dbcredentials.txt
env
*.pyc
/target
201 changes: 201 additions & 0 deletions License.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright {yyyy} {name of copyright owner}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# analyst-collective/analytics

This repository serves as an index for various dbt-based analytics packages. Please add additional packages by submitting PRs.

- [Stripe](https://github.com/fishtown-analytics/stripe)
- [Snowplow](https://github.com/fishtown-analytics/snowplow)
- [Quickbooks](https://github.com/fishtown-analytics/quickbooks)
- [Zendesk](https://github.com/analyst-collective/zendesk)
- [Mailchimp](https://github.com/analyst-collective/mailchimp)


These packages are all installed and built using dbt. For additional information on dbt, go [here](https://github.com/analyst-collective/dbt).
42 changes: 0 additions & 42 deletions analysis/event_stream/funnel.sql

This file was deleted.

9 changes: 0 additions & 9 deletions analysis/event_stream/interface.txt

This file was deleted.

8 changes: 0 additions & 8 deletions analysis/event_stream/timeseries.sql

This file was deleted.

4 changes: 0 additions & 4 deletions config.json

This file was deleted.

17 changes: 17 additions & 0 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#settings specifically for this models directory
#config other dbt settings within ~/.dbt/profiles.yml
name: 'Analyst_Collective'
version: '1.0'

source-paths: ["models"]
target-path: "target"
clean-targets: ["target"]
test-paths: ["test"]

model-defaults:
materialized: false
enabled: true

#models:
# zuora:
# materialized: true
27 changes: 27 additions & 0 deletions deprecated-analysis/mrr/active_mrr.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
with
charges_for_active_plans as
(
select *
from {{env.schema}}.zuora_subscriptions_w_charges_and_amendments
where
-- make sure the subscription is active
subscr_status = 'Active'
and
(
-- make sure the rate plan charge is current
(
rpc_start <= current_date
and
rpc_end >= current_date
)
or subscr_term_type = 'EVERGREEN'
)
and rpc_last_segment = TRUE
)


-- get the active mrr per account
select account_number, round(sum(mrr),2) as active_mrr
from charges_for_active_plans
group by account_number

Loading