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/update joins #13

Merged
merged 8 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# 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.

fivetran-jamie marked this conversation as resolved.
Show resolved Hide resolved
# 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
fivetran-jamie marked this conversation as resolved.
Show resolved Hide resolved
on customers_charge_lines.purchase_item_id = subscriptions.subscription_id
group by 1

), subscriptions_enriched as (
Expand Down
7 changes: 5 additions & 2 deletions packages.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
packages:
- package: fivetran/recharge_source
version: [">=0.1.0", "<0.2.0"]
# - package: fivetran/recharge_source
# version: [">=0.1.0", "<0.2.0"]
- git: https://github.com/fivetran/dbt_recharge_source.git
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

obligatory reminder to update before release

revision: bug/most-recent-record
warn-unpinned: false