Skip to content

Commit

Permalink
Update/metrics 0.3.5 (#22)
Browse files Browse the repository at this point in the history
* update to dbt_metrics_0.3.2

* update/metrics_0.3.5

Co-authored-by: Aryan Verma <[email protected]>
  • Loading branch information
AryanMadhavVerma and Aryan Verma authored Sep 28, 2022
1 parent 64fc634 commit bc0d843
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 19 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Stripe Metrics dbt Package ([Docs](https://housewarehq.github.io/dbt_stripe_metrics))

# 🛑 Few things to keep in mind
These packages are under active development and are expected to change with dbt metrics as it evolves over time. As of now, dbt metrics requires users to define models to calculate metrics and these models are persisted on the warehouse. Keeping this in mind, we have currently modelled our packages such that metrics and the models calculating these metrics have a 1:1 mapping, which is why you will see multiple metrics for the same conceptual metric entity accounting for different time grains and dimensions. In future, with the roll out of dbt Server and evolution of dbt metrics, we expect to streamline our packages to remove these redundancies.

The metrics in these packages are transformed on top of source data ETL'd via Fivetran to your warehouse. Make sure you have connected your SaaS source with Fivetran for the packages to work properly.

# 📣 What does this dbt package do?
This package provides pre-built metrics for Stripe data from [Fivetran's connector](https://fivetran.com/docs/applications/stripe). It uses data in the format described by [this ERD](https://fivetran.com/docs/applications/stripe#schemainformation).

Expand Down
4 changes: 2 additions & 2 deletions models/metrics/stripe__monthly_bookings.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- depends_on: {{ ref('stripe__main_transactions') }}

select *
from {{ metrics.metric(
metric_name='stripe__monthly_bookings',
from {{ metrics.calculate(
metric('stripe__monthly_bookings'),
grain='month',
dimensions=[],
secondary_calculations=[]
Expand Down
4 changes: 2 additions & 2 deletions models/metrics/stripe__monthly_churned_customer_revenue.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- depends_on: {{ ref('stripe__monthly_customer_revenue') }}

select *
from {{ metrics.metric(
metric_name='stripe__monthly_churned_customer_revenue',
from {{ metrics.calculate(
metric('stripe__monthly_churned_customer_revenue'),
grain='month',
dimensions=[],
secondary_calculations=[]
Expand Down
4 changes: 2 additions & 2 deletions models/metrics/stripe__monthly_churned_customers.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- depends_on: {{ ref('stripe__monthly_customer_revenue') }}

select *
from {{ metrics.metric(
metric_name='stripe__monthly_churned_customers',
from {{ metrics.calculate(
metric('stripe__monthly_churned_customers'),
grain='month',
dimensions=[],
secondary_calculations=[]
Expand Down
4 changes: 2 additions & 2 deletions models/metrics/stripe__monthly_new_customer_revenue.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- depends_on: {{ ref('stripe__monthly_customer_revenue') }}

select *
from {{ metrics.metric(
metric_name='stripe__monthly_new_customer_revenue',
from {{ metrics.calculate(
metric('stripe__monthly_new_customer_revenue'),
grain='month',
dimensions=[],
secondary_calculations=[]
Expand Down
4 changes: 2 additions & 2 deletions models/metrics/stripe__monthly_new_customers.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- depends_on: {{ ref('stripe__monthly_customer_revenue') }}

select *
from {{ metrics.metric(
metric_name='stripe__monthly_new_customers',
from {{ metrics.calculate(
metric('stripe__monthly_new_customers'),
grain='month',
dimensions=[],
secondary_calculations=[]
Expand Down
4 changes: 2 additions & 2 deletions models/metrics/stripe__monthly_platform_fees.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- depends_on: {{ ref('stripe__main_transactions') }}

select *
from {{ metrics.metric(
metric_name='stripe__monthly_platform_fees',
from {{ metrics.calculate(
metric('stripe__monthly_platform_fees'),
grain='month',
dimensions=[],
secondary_calculations=[]
Expand Down
4 changes: 2 additions & 2 deletions models/metrics/stripe__monthly_recovered_customer_revenue.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- depends_on: {{ ref('stripe__monthly_customer_revenue') }}

select *
from {{ metrics.metric(
metric_name='stripe__monthly_recovered_customer_revenue',
from {{ metrics.calculate(
metric('stripe__monthly_recovered_customer_revenue'),
grain='month',
dimensions=[],
secondary_calculations=[]
Expand Down
4 changes: 2 additions & 2 deletions models/metrics/stripe__monthly_recovered_customers.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- depends_on: {{ ref('stripe__monthly_customer_revenue') }}

select *
from {{ metrics.metric(
metric_name='stripe__monthly_recovered_customers',
from {{ metrics.calculate(
metric('stripe__monthly_recovered_customers'),
grain='month',
dimensions=[],
secondary_calculations=[]
Expand Down
4 changes: 2 additions & 2 deletions models/metrics/stripe__mrr.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- depends_on: {{ ref('stripe__monthly_customer_revenue') }}

select *
from {{ metrics.metric(
metric_name='stripe__mrr',
from {{ metrics.calculate(
metric('stripe__mrr'),
grain='month',
dimensions=[],
secondary_calculations=[metrics.rolling(aggregate="average", interval=3, alias="roll_avg_quarter")]
Expand Down
2 changes: 1 addition & 1 deletion packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ packages:
version: 0.6.0

- package: dbt-labs/metrics
version: 0.1.5
version: 0.3.5

0 comments on commit bc0d843

Please sign in to comment.