Skip to content

Commit

Permalink
Merge pull request #13 from fivetran/feature/update-joins
Browse files Browse the repository at this point in the history
Feature/update joins
  • Loading branch information
fivetran-catfritz authored Sep 14, 2023
2 parents 0dde3f5 + cd0225a commit 0c5f0af
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 16 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# dbt_Recharge_source v0.1.1
[PR #13](https://github.com/fivetran/dbt_recharge/pull/13) includes the following updates:
## Features
- Updated the join logic for `recharge__subscription_overview` to produce more accurate results.
- The [source package](https://github.com/fivetran/dbt_recharge_source/) model `stg_recharge__subscription_history` was updated to use the source's `updated_at` column to determine most recent record. See the source package [CHANGELOG](https://github.com/fivetran/dbt_recharge_source/blob/main/CHANGELOG.md) for more details.

# dbt_Recharge_source v0.1.0
🎉 This is the initial release of this package! 🎉
# 📣 What does this dbt package do?
- Produces modeled tables that leverage Recharge data from [Fivetran's connector](https://fivetran.com/docs/applications/recharge) in the format described by [this ERD](https://fivetran.com/docs/applications/recharge#schemainformation) and build off the output of our [Recharge source package](https://github.com/fivetran/dbt_recharge_source).
- Enables you to better understand your Recharge data by summarizing customer, revenue, and subscription trends.
- Generates a comprehensive data dictionary of your source and modeled Recharge data through the [dbt docs site](https://fivetran.github.io/dbt_recharge/).

For more information refer to the [README](https://github.com/fivetran/dbt_recharge/blob/main/README.md).
For more information refer to the [README](https://github.com/fivetran/dbt_recharge/blob/main/README.md).
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

name: 'recharge'
version: '0.1.0'
version: '0.1.1'
config-version: 2
require-dbt-version: [">=1.3.0", "<2.0.0"]

Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/run_results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config-version: 2

name: 'recharge_integration_tests'
version: '0.1.0'
version: '0.1.1'

profile: 'integration_tests'

Expand Down
7 changes: 2 additions & 5 deletions models/recharge__subscription_overview.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ with subscriptions as (
), customers_charge_lines as (
select
charge_line_items.charge_id,
charge_line_items.purchase_item_id,
charge_line_items.external_product_id_ecommerce,
charge_line_items.external_variant_id_ecommerce,
charges.customer_id,
Expand All @@ -37,11 +38,7 @@ with subscriptions as (
end) as count_queued_charges
from subscriptions
left join customers_charge_lines
on customers_charge_lines.customer_id = subscriptions.customer_id
and customers_charge_lines.address_id = subscriptions.address_id
and customers_charge_lines.external_product_id_ecommerce = subscriptions.external_product_id_ecommerce
where subscriptions.subscription_created_at <= customers_charge_lines.charge_created_at
and subscriptions.subscription_cancelled_at >= customers_charge_lines.charge_created_at
on customers_charge_lines.purchase_item_id = subscriptions.subscription_id
group by 1

), subscriptions_enriched as (
Expand Down
4 changes: 2 additions & 2 deletions packages.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
packages:
- package: fivetran/recharge_source
version: [">=0.1.0", "<0.2.0"]
- package: fivetran/recharge_source
version: [">=0.1.0", "<0.2.0"]

0 comments on commit 0c5f0af

Please sign in to comment.