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

Feature/mvp package #1

Merged
merged 25 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
04c7036
🔧 Add poetry setup files
jurrigerretsen Jan 16, 2024
eac3a93
📝 Add placeholder readme's
jurrigerretsen Jan 16, 2024
1a1a4d3
🔧 Setup integration test files
jurrigerretsen Jan 16, 2024
7f29db4
🤡 Add mocked data
jurrigerretsen Jan 16, 2024
dc56fb8
🔧 Update source yaml + macro
jurrigerretsen Jan 16, 2024
bfbdd81
🚚 Moved setup files to integration tests
jurrigerretsen Jan 23, 2024
c23abe5
🚚 Renamed mock data
jurrigerretsen Jan 23, 2024
08fd7e9
✨ Added & moved models
jurrigerretsen Jan 23, 2024
63ef21d
🚨 Fix sqlfluff linting
jurrigerretsen Jan 23, 2024
968635e
📝 Add documentation & testing
jurrigerretsen Jan 23, 2024
042e929
📝 Update column descriptions
jurrigerretsen Jan 23, 2024
0bbd696
✨ Add product id to each analysis table
jurrigerretsen Jan 23, 2024
864bf5a
⚡️ limit date_spine cross join
jurrigerretsen Jan 23, 2024
ad113c3
✨ update models + docs
jurrigerretsen Jan 26, 2024
2a29bb6
🚚 Renaming & documentation
jurrigerretsen Feb 14, 2024
6dfc5db
🚚 Rename mrr
jurrigerretsen Feb 14, 2024
03f4ebb
✅ Add tests
jurrigerretsen Feb 14, 2024
86565c0
✅ Fix failing test
jurrigerretsen Feb 14, 2024
0507b7a
📝 Add readme
jurrigerretsen Feb 14, 2024
a66ae08
📝 Fix column naming convention
jurrigerretsen Feb 14, 2024
e1c1967
✨ Update incremental logic
jurrigerretsen Feb 14, 2024
954cc33
✅ Add mrr test compare to seed
jurrigerretsen Feb 15, 2024
2a419d3
✨ remove prs reference and fix integration test
jurrigerretsen Feb 15, 2024
17f4f92
✏️ Fix typo
jurrigerretsen Feb 15, 2024
81250ba
🐛 update UTMs in readme
tomshelllby Feb 20, 2024
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
12 changes: 12 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This CODEOWNERS file defines ownership of specific folders within this repo
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# these teams/reviewers will be requested for
# review when someone opens a pull request.
* @TasmanAnalytics/analytics-engineering


# All files in the below directory and any of its
# subdirectories will be owned by the specified team
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
target/
dbt_modules/
dbt_packages/
logs/
.venv
.env
.DS_Store
57 changes: 57 additions & 0 deletions .sqlfluff
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[sqlfluff]
dialect = snowflake
templater = dbt
exclude_rules = structure.column_order, convention.not_equal, references.keywords, aliasing.unused
max_line_length = 500

[sqlfluff:templater:dbt]
project_dir = ./
profile = tasman_integration_tests

[sqlfluff:templater:jinja]
apply_dbt_builtins = True

[sqlfluff:indentation]
indented_on_contents = False
template_blocks_indent = False
tab_space_size = 4
indent_unit = space

[sqlfluff:rules:capitalisation.keywords]
# Keywords
capitalisation_policy = lower

[sqlfluff:rules:capitalisation.identifiers]
# Unquoted identifiers
extended_capitalisation_policy = lower

[sqlfluff:rules:layout.long_lines]
# Line length
ignore_comment_lines = True
ignore_comment_clauses = True

[sqlfluff:rules:capitalisation.functions]
# Function names
extended_capitalisation_policy = lower

[sqlfluff:rules:capitalisation.literals]
# Null & Boolean Literals
capitalisation_policy = lower

[sqlfluff:rules:ambiguous.column_references]
# GROUP BY/ORDER BY column references
group_by_and_order_by_style = explicit

[sqlfluff:rules:references.special_chars]
# Special characters in identifiers
unquoted_identifiers_policy = all
quoted_identifiers_policy = none
allow_space_in_identifier = False

[sqlfluff:rules:capitalisation.types]
# Data Types
extended_capitalisation_policy = lower

[sqlfluff:rules:convention.casting_style]
# SQL type casting
preferred_type_casting_style = shorthand
4 changes: 4 additions & 0 deletions .sqlfluffignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target/
dbt_packages/
macros/
.venv/
File renamed without changes.
Empty file added CONTRIBUTING.md
Empty file.
Empty file added LICENSE
Empty file.
10 changes: 6 additions & 4 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: 'tasman_dbt_revenuecat'
version: '0.0.1'

require-dbt-version: [">=1.3.0", "<2.0.0"]

config-version: 2
require-dbt-version: [">=1.6.0", "<2.0.0"]

target-path: "target"
#clean-targets: ["target", "dbt_modules", "dbt_packages"]
macro-paths: ["macros"]
clean-targets: ["target", "dbt_modules", "dbt_packages"]
log-path: "logs"

models:
tasman_dbt_revenuecat:
tomshelllby marked this conversation as resolved.
Show resolved Hide resolved
+materialized: table
4 changes: 4 additions & 0 deletions integration_tests/.sqlfluffignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target/
dbt_packages/
macros/
.venv/
14 changes: 14 additions & 0 deletions integration_tests/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!make
.PHONY: help poetry dbt
.DEFAULT_GOAL := help

# Initialisation recipes
poetry: ## Install poetry
@if ! command -v poetry; then\
curl -sSL https://install.python-poetry.org | python3 -;\
fi
poetry install --directory ../

# dbt Development recipes
dbt: poetry ## Start a dbt shell
export DBT_PROFILES_DIR=~/.dbt/ && export SHELL=/bin/zsh && poetry shell
11 changes: 11 additions & 0 deletions integration_tests/data/seed_revenuecat_transactions_mocked.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
rc_original_app_user_id,rc_last_seen_app_user_id_alias,country,product_identifier,start_time,end_time,store,is_auto_renewable,is_trial_period,is_in_intro_offer_period,is_sandbox,price_in_usd,takehome_percentage,store_transaction_id,original_store_transaction_id,refunded_at,unsubscribe_detected_at,billing_issues_detected_at,purchased_currency,price_in_purchased_currency,entitlement_identifiers,renewal_number,is_trial_conversion,presented_offering,reserved_subscriber_attributes,custom_subscriber_attributes,platform,tax_percentage,commission_percentage,effective_end_time,grace_period_end_time,ownership_type,country_source,experiment_id,experiment_variant,purchase_price_in_usd,purchase_price_in_purchased_currency,product_display_name,product_duration,updated_at,offer,offer_type,first_seen_time,auto_resume_time,_file_name
7a33a09e3d8f44aa9030d4d9c1e17b57,7a33a09e3d8f44aa9030d4d9c1e17b57,US,ad44a251d1ff4af8a01cacea42dfdd55,2023-12-10 20:02:01,2023-12-12 1:35:31,app_store,TRUE,FALSE,FALSE,FALSE,0,0.85,8573956325,8573956325,2023-12-12 1:35:31,2023-12-11 2:58:16,,USD,0,[premium],1,FALSE,standard,{},{},iOS,0,0.15,2023-12-12 1:35:31,,PURCHASED,last_seen,,,9,9,banana_subscription,P1M,2024-01-16 7:49:01,,,,,tasman-dbt-revenuecat/2024-02-01/transactions_1706757920.csv.gz
bade7e1ec94e418d9e5ac569db27dac2,bade7e1ec94e418d9e5ac569db27dac2,US,ad44a251d1ff4af8a01cacea42dfdd55,2022-11-01 14:10:31,2023-11-01 14:10:31,app_store,TRUE,FALSE,FALSE,FALSE,99,0.7,5481613729,5481613729,,,,USD,99,[premium],1,FALSE,standard,{},{},iOS,0,0.3,2023-10-18 19:40:13,,PURCHASED,from_sdk,,,99,99,banana_subscription,P1M,2024-01-16 7:49:01,,,,,tasman-dbt-revenuecat/2024-02-01/transactions_1706757920.csv.gz
bade7e1ec94e418d9e5ac569db27dac2,bade7e1ec94e418d9e5ac569db27dac2,US,ad44a251d1ff4af8a01cacea42dfdd55,2023-11-01 14:10:31,2024-11-01 14:10:31,app_store,TRUE,FALSE,FALSE,FALSE,99,0.7,7799213102,5481613729,,,,USD,99,[premium],2,FALSE,standard,{},{},iOS,0,0.3,2024-10-18 19:40:13,,PURCHASED,from_sdk,,,99,99,banana_subscription,P1M,2024-01-16 7:49:01,,,,,tasman-dbt-revenuecat/2024-02-01/transactions_1706757920.csv.gz
0c13ff8b80614616aa3ef2d649dc2d1e,0c13ff8b80614616aa3ef2d649dc2d1e,US,0c13ff8b80614616aa3ef2d649dc2d1e,2023-02-12 16:16:05,2024-02-12 16:16:05,app_store,TRUE,FALSE,FALSE,FALSE,99,0.7,9728104118,3225356759,,2023-02-12 13:08:25,,USD,99,,2,TRUE,standard,{},{},iOS,0,0.3,2024-02-12 16:16:05,,PURCHASED,last_seen,,,99,99,cherry_subscription,P1Y,2024-01-16 7:49:01,,,,,tasman-dbt-revenuecat/2024-02-01/transactions_1706757920.csv.gz
0c13ff8b80614616aa3ef2d649dc2d1e,0c13ff8b80614616aa3ef2d649dc2d1e,US,0c13ff8b80614616aa3ef2d649dc2d1e,2023-02-05 16:16:05,2023-02-12 16:16:05,app_store,TRUE,TRUE,FALSE,FALSE,0,0.7,3225356759,3225356759,,2023-02-12 13:08:25,,USD,0,,1,FALSE,standard,{},{},iOS,0,0.3,2023-02-12 16:16:05,,PURCHASED,last_seen,,,0,0,cherry_subscription,P1Y,2024-01-16 7:49:01,,,,,tasman-dbt-revenuecat/2024-02-01/transactions_1706757920.csv.gz
024ea3b3405c461a9e8cf6464ee8d15c,024ea3b3405c461a9e8cf6464ee8d15c,US,0c13ff8b80614616aa3ef2d649dc2d1e,2024-01-03 7:15:52,2024-01-05 7:21:58,play_store,TRUE,FALSE,FALSE,FALSE,0,0.85,GPA.720684291,GPA.720684291,,,2024-01-03 7:16:07,USD,0,[premium],1,FALSE,discount,{},{},android,0,0.15,2024-01-17 7:15:52,2024-01-17 7:15:52,PURCHASED,from_sdk,,,0,0,cherry_subscription,P1Y,2024-01-16 7:49:01,,,,,tasman-dbt-revenuecat/2024-02-01/transactions_1706757920.csv.gz
107771c8cf144ebf99a124a97fe032e2,107771c8cf144ebf99a124a97fe032e2,US,ad44a251d1ff4af8a01cacea42dfdd55,2023-03-29 16:24:32,2023-04-29 18:24:24,play_store,TRUE,FALSE,FALSE,FALSE,9,0.85,GPA.3691355300,GPA.3691355300,,,,USD,9,[premium],1,FALSE,standard,{},{},android,0,0.15,2023-04-29 18:24:24,,PURCHASED,last_seen,,,9,9,banana_subscription,P1M,2024-01-16 7:49:01,,,,,tasman-dbt-revenuecat/2024-02-01/transactions_1706757920.csv.gz
107771c8cf144ebf99a124a97fe032e2,107771c8cf144ebf99a124a97fe032e2,US,ad44a251d1ff4af8a01cacea42dfdd55,2023-04-29 18:24:24,2023-05-29 18:24:24,play_store,TRUE,FALSE,FALSE,FALSE,9,0.85,GPA.4157746541..0,GPA.3691355300,,,,USD,9,[premium],2,FALSE,standard,{},{},android,0,0.15,2023-05-29 18:24:24,,PURCHASED,last_seen,,,9,9,banana_subscription,P1M,2024-01-16 7:49:01,,,,,tasman-dbt-revenuecat/2024-02-01/transactions_1706757920.csv.gz
107771c8cf144ebf99a124a97fe032e2,107771c8cf144ebf99a124a97fe032e2,US,ad44a251d1ff4af8a01cacea42dfdd55,2023-04-29 18:24:24,2023-05-29 18:24:24,play_store,TRUE,FALSE,FALSE,FALSE,9,0.85,GPA.4157746541..0,GPA.3691355300,,,,USD,9,[premium],2,FALSE,standard,{},{},android,0,0.15,2023-05-29 18:24:24,,PURCHASED,last_seen,,,9,9,banana_subscription,P1M,2024-01-16 7:49:01,,,,,tasman-dbt-revenuecat/2024-02-01/transactions_1706757920.csv.gz
107771c8cf144ebf99a124a97fe032e2,107771c8cf144ebf99a124a97fe032e2,US,ad44a251d1ff4af8a01cacea42dfdd55,2023-04-29 18:24:24,2023-05-29 18:24:24,play_store,TRUE,FALSE,FALSE,TRUE,9,0.85,GPA.4157746541..0,GPA.3691355300,,,,USD,9,[premium],2,FALSE,standard,{},{},android,0,0.15,2023-05-29 18:24:24,,PURCHASED,last_seen,,,9,9,banana_subscription,P1M,2024-01-16 7:49:01,,,,,tasman-dbt-revenuecat/2024-02-01/transactions_1706757920.csv.gz
69 changes: 69 additions & 0 deletions integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: 'tasman_dbt_revenuecat_integration_tests'
version: '1.0'

config-version: 2

profile: 'tasman_integration_tests'

seed-paths: ["data"]
macro-paths: ["macros"]
target-path: "target"
clean-targets: ["target", "dbt_modules", "dbt_packages"]
log-path: "logs"

vars:
tasman_dbt_revenuecat:
revenuecat_table: "SEED_REVENUECAT_TRANSACTIONS_MOCKED"
revenuecat_filter: "is_sandbox = false"
revenuecat_custom_subscriber_attributes: ""
revenuecat_mrr_test_seed: ""

seeds:
tasman_dbt_revenuecat_integration_tests:
seed_revenuecat_transactions_mocked:
+column_types:
rc_original_app_user_id: "string"
rc_last_seen_app_user_id_alias: "string"
country: "string"
product_identifier: "string"
start_time: "timestamp_ntz"
end_time: "timestamp_ntz"
store: "string"
is_auto_renewable: "boolean"
is_trial_period: "boolean"
is_in_intro_offer_period: "boolean"
is_sandbox: "boolean"
price_in_usd: "integer"
takehome_percentage: "float"
store_transaction_id: "string"
original_store_transaction_id: "string"
refunded_at: "timestamp_ntz"
unsubscribe_detected_at: "timestamp_ntz"
billing_issues_detected_at: "timestamp_ntz"
purchased_currency: "string"
price_in_purchased_currency: "integer"
entitlement_identifiers: "string"
renewal_number: "integer"
is_trial_conversion: "boolean"
presented_offering: "string"
reserved_subscriber_attributes: "string"
custom_subscriber_attributes: "string"
platform: "string"
tax_percentage: "integer"
commission_percentage: "float"
effective_end_time: "timestamp_ntz"
grace_period_end_time: "timestamp_ntz"
ownership_type: "string"
country_source: "string"
experiment_id: "integer"
experiment_variant: "integer"
purchase_price_in_usd: "integer"
purchase_price_in_purchased_currency: "integer"
product_display_name: "string"
product_duration: "string"
updated_at: "timestamp_ntz"
offer: "integer"
offer_type: "integer"
first_seen_time: "timestamp_ntz"
auto_resume_time: "timestamp_ntz"
_file_name: "string"
5 changes: 5 additions & 0 deletions integration_tests/package-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
packages:
- local: ../
- package: dbt-labs/dbt_utils
version: 1.1.1
sha1_hash: 7ddc9cc629d204960cdbec3d712481aace9ed5d3
5 changes: 5 additions & 0 deletions integration_tests/packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
packages:
- local: ../

- package: dbt-labs/dbt_utils
version: 1.1.1
Loading