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/q3 2023 updates #69

Merged
merged 48 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
701fb77
add new balance transaction int model
fivetran-reneeli Aug 30, 2023
fd8ebb9
activity itemized 2 model
fivetran-reneeli Aug 31, 2023
90226fe
balance change from activity itemized 3
fivetran-reneeli Aug 31, 2023
de5a9f7
versioning
fivetran-reneeli Aug 31, 2023
9033a47
versioning
fivetran-reneeli Aug 31, 2023
ffc7cbc
yml
fivetran-reneeli Sep 7, 2023
697680f
rm doc additions
fivetran-reneeli Sep 7, 2023
51518ee
fixes
fivetran-reneeli Sep 8, 2023
7ff9c3c
payout itemized 3
fivetran-reneeli Sep 14, 2023
5dcb2b8
add balance rec itemized 4 & int payout enhanced model
fivetran-reneeli Sep 15, 2023
169e185
finalize report descriptions
fivetran-reneeli Sep 18, 2023
980544f
standardize the int models
fivetran-reneeli Sep 18, 2023
2d57491
ensure final column names match report
fivetran-reneeli Sep 19, 2023
73542a8
finalize yml
fivetran-reneeli Sep 20, 2023
35cb9cd
docs
fivetran-reneeli Sep 20, 2023
7bd4d46
updates
fivetran-reneeli Sep 21, 2023
03bc4f2
updates 2
fivetran-reneeli Sep 21, 2023
f39905d
suffix arrival date with _at in source, update downstream
fivetran-reneeli Sep 21, 2023
8b01641
updates
fivetran-reneeli Sep 21, 2023
1c657a5
add vars
fivetran-reneeli Sep 22, 2023
dc44025
typo
fivetran-reneeli Sep 22, 2023
a9f38f5
try snowflake fix
fivetran-reneeli Sep 22, 2023
3bea469
try snowflake fix 2
fivetran-reneeli Sep 22, 2023
63bb4fc
changelog and fix identifier formatting
fivetran-reneeli Oct 10, 2023
7162568
updates
fivetran-reneeli Oct 10, 2023
ca97fc2
fix snowflake error
fivetran-reneeli Oct 11, 2023
340cbce
snowflake fix
fivetran-reneeli Oct 11, 2023
a559cf5
swap enhanced int balance txn model
fivetran-reneeli Oct 12, 2023
ff8b7bd
temp snowflake test pass
fivetran-reneeli Oct 13, 2023
7c1e349
Update models/intermediate/int_stripe__payout_enhanced.sql
fivetran-reneeli Oct 13, 2023
1ddf0eb
Update models/stripe_reports/stripe__payout_itemized_3.sql
fivetran-reneeli Oct 13, 2023
27972d7
updates
fivetran-reneeli Oct 13, 2023
57f5fca
changelog
fivetran-reneeli Oct 13, 2023
b11418a
rework balance transaction model
fivetran-reneeli Oct 17, 2023
11ed832
rm int payouts model
fivetran-reneeli Oct 17, 2023
33fd132
docs
fivetran-reneeli Oct 17, 2023
f809ebe
docs
fivetran-reneeli Oct 17, 2023
a9bf2f0
Update CHANGELOG.md
fivetran-reneeli Oct 18, 2023
3793823
updates
fivetran-reneeli Oct 18, 2023
71100bb
try 2
fivetran-reneeli Oct 18, 2023
aa51141
try 3
fivetran-reneeli Oct 18, 2023
cea74b2
docs
fivetran-reneeli Oct 18, 2023
367503c
Update CHANGELOG.md
fivetran-reneeli Oct 18, 2023
ed780b2
Update CHANGELOG.md
fivetran-reneeli Oct 18, 2023
fed9908
docs
fivetran-reneeli Oct 18, 2023
114e51d
docs
fivetran-reneeli Oct 18, 2023
5b1dd93
add more to changelog entry
fivetran-reneeli Oct 18, 2023
7a359dc
update deps
fivetran-reneeli Oct 18, 2023
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
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# dbt_stripe v0.UPDATE.UPDATE

## Under the Hood:
# dbt_stripe v0.11.0
[PR #69](https://github.com/fivetran/dbt_stripe/pull/69) contains the following updates:
## Updates:
fivetran-joemarkiewicz marked this conversation as resolved.
Show resolved Hide resolved
- Introduced the following new models, named after the Stripe reports that they follow:
- stripe__activity_itemized_2
- stripe__balance_change_from_activity_itemized_3
- stripe__ending_balance_reconciliation_itemized_4
- stripe__payout_itemized_3
fivetran-joemarkiewicz marked this conversation as resolved.
Show resolved Hide resolved

## Under the Hood:

- Incorporated the new `fivetran_utils.drop_schemas_automation` macro into the end of each Buildkite integration test job.
- Updated the pull request [templates](/.github).
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Include the following stripe package version in your `packages.yml` file:
```yaml
packages:
- package: fivetran/stripe
version: [">=0.10.0", "<0.11.0"]
version: [">=0.11.0", "<0.12.0"]
fivetran-joemarkiewicz marked this conversation as resolved.
Show resolved Hide resolved

```
Do **NOT** include the `stripe_source` package in this file. The transformation package itself has a dependency on it and will install the source package as well.
Expand Down Expand Up @@ -232,7 +232,7 @@ This dbt package is dependent on the following dbt packages. Please be aware tha
```yml
packages:
- package: fivetran/stripe_source
version: [">=0.9.0", "<0.10.0"]
version: [">=0.10.0", "<0.11.0"]

- package: fivetran/fivetran_utils
version: [">=0.4.0", "<0.5.0"]
Expand Down
4 changes: 3 additions & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config-version: 2
name: 'stripe'

version: '0.10.1'
version: '0.11.0'
require-dbt-version: [">=1.3.0", "<2.0.0"]
models:
stripe:
Expand All @@ -16,6 +16,7 @@ vars:
card: "{{ ref('stg_stripe__card') }}"
charge: "{{ ref('stg_stripe__charge') }}"
customer: "{{ ref('stg_stripe__customer') }}"
dispute: "{{ ref('stg_stripe__dispute') }}"
fee: "{{ ref('stg_stripe__fee') }}"
invoice: "{{ ref('stg_stripe__invoice') }}"
invoice_line_item: "{{ ref('stg_stripe__invoice_line_item') }}"
Expand All @@ -26,3 +27,4 @@ vars:
price_plan: "{{ ref('stg_stripe__price_plan') }}"
refund: "{{ ref('stg_stripe__refund') }}"
subscription: "{{ ref('stg_stripe__subscription') }}"
transfer: "{{ ref('stg_stripe__transfer') }}"
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 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.

8 changes: 7 additions & 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: 'stripe_integration_tests'
version: '0.10.1'
version: '0.11.0'

profile: 'integration_tests'

Expand All @@ -14,6 +14,7 @@ vars:
stripe_card_identifier: "card_data"
stripe_charge_identifier: "charge_data"
stripe_customer_identifier: "customer_data"
stripe_dispute_identifier: "dispute_data"
stripe_fee_identifier: "fee_data"
stripe_invoice_identifier: "invoice_data"
stripe_invoice_line_item_identifier: "invoice_line_item_data"
Expand All @@ -26,6 +27,7 @@ vars:
stripe_refund_identifier: "refund_data"
stripe_subscription_history_identifier: "subscription_history_data"
stripe_subscription_identifier: "subscription_data"
stripe_transfer_identifier: "transfer_data"
stripe_credit_note_identifier: "credit_note_data"
stripe_credit_note_line_item_identifier: "credit_note_line_item_data"

Expand All @@ -51,6 +53,10 @@ seeds:
customer_data:
+column_types:
description: "{{ 'varchar(500)' if target.type in ('redshift','postgres') else 'string'}}"
payout_data:
+column_types:
destination_bank_account_id: "{{ 'varchar(500)' if target.type in ('redshift','postgres') else 'string'}}"
destination_card_id: "{{ 'varchar(500)' if target.type in ('redshift','postgres') else 'string'}}"

dispatch:
- macro_namespace: dbt_utils
Expand Down
4 changes: 3 additions & 1 deletion integration_tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
dbt-snowflake>=1.3.0,<2.0.0
dbt-bigquery>=1.3.0,<2.0.0
dbt-redshift>=1.3.0,<1.5.0
dbt-redshift>=1.3.0,<2.0.0
dbt-postgres>=1.3.0,<2.0.0
dbt-spark>=1.3.0,<2.0.0
dbt-spark[PyHive]>=1.3.0,<2.0.0
dbt-databricks>=1.3.0,<2.0.0

oscrypto @ git+https://github.com/wbond/oscrypto.git@d5f3437
11 changes: 11 additions & 0 deletions integration_tests/seeds/dispute_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
id,_fivetran_synced,amount,balance_transaction,charge_id,connected_account_id,created,currency,evidence_access_activity_log,evidence_billing_address,evidence_cancellation_policy,evidence_cancellation_policy_disclosure,evidence_cancellation_rebuttal,evidence_customer_communication,evidence_customer_email_address,evidence_customer_name,evidence_customer_purchase_ip,evidence_customer_signature,evidence_details_due_by,evidence_details_has_evidence,evidence_details_past_due,evidence_details_submission_count,evidence_duplicate_charge_documentation,evidence_duplicate_charge_explanation,evidence_duplicate_charge_id,evidence_product_description,evidence_receipt,evidence_refund_policy,evidence_refund_policy_disclosure,evidence_refund_refusal_explanation,evidence_service_date,evidence_service_documentation,evidence_shipping_address,evidence_shipping_carrier,evidence_shipping_date,evidence_shipping_documentation,evidence_shipping_tracking_number,evidence_uncategorized_file,evidence_uncategorized_text,is_charge_refundable,livemode,metadata,reason,status
du_0MmTsrig6peNXzgD4bsS3XWF,2023-06-02 08:23:57,1234,txn_0MmTt4ig6peNXzgDDEp8wsKh,ch_2MZdKRig6peNXzgD0EygIk7l,,2023-03-17 03:23:13,usd,,,,,,,,,,,2023-04-26 23:59:59.000000 UTC,true,false,1,,,,,,,,,,,,,,,,,,true,true,"""{""netsuite_credit_memo_id"":""3324234"",""netsuite_credit_memo_link"":""https://en.wikipedia.org/wiki/Brave_New_World"",""netsuite_customer_refund_id"":""3524872"",""netsuite_customer_refund_link"":""https://en.wikipedia.org/wiki/Aldous_Huxley""}""",product_unacceptable,won
du_0Lvivfig6peNXzgD33SIekHq,2022-12-21 20:19:05,3333,txn_0LviwVig6peNXzgDkSPS1Y1C,ch_2LqbkJig6peNXzgD1jG4Xy7z,,2022-10-22 14:44:03,usd,,,,,,,,,,,2022-11-17 23:59:59.000000 UTC,false,false,1,,,,,,,,,,,,,,,,,,true,true,,general,won
du_0KHowkig6peNXzgDyhndDHOe,2022-09-23 00:00:24,3331,txn_0KHoxcig6peNXzgDKWarDbF0,ch_2JtdoJig6peNXzgD1lCAvXwG,,2022-01-14 12:31:58,usd,,"1600 Pennsylvania Avenue NW, Washington, DC 20500",,,,,[email protected],Aldous Huxley,68.1.21.555,,2022-02-09 23:59:59.000000 UTC,false,false,1,,,,,file_0KHowoig6peNXzgDyeDmylk3,,,,,,,,,,,,,true,true,,general,won
du_0M9SJTig6peNXzgD58OLM8Mz,2022-12-12 20:19:03,1099,txn_0M9SKaig6peNXzgDlb5cqlBg,ch_2M2d6mig6peNXzgD03nrNVYZ,,2022-11-29 11:49:23,usd,,,,,,,,,,,2022-12-25 23:59:59.000000 UTC,false,false,0,,,,,,,,,,,,,,,,,,false,true,,subscription_canceled,lost
du_0LuGYgig6peNXzgDM8lPBTFC,2022-11-14 14:21:25,1222,txn_0LuGZyig6peNXzgDLgWzetHo,ch_2LUt28ig6peNXzgD0RdFu0qW,,2022-10-18 14:14:18,usd,,,,,,,,,,,2022-11-13 23:59:59.000000 UTC,false,false,0,,,,,,,,,,,,,,,,,,false,true,,subscription_canceled,lost
du_0LyvFuig6peNXzgDyBMCjDi6,2022-11-27 14:20:24,221244,txn_0LyvHhig6peNXzgDg5LanDAq,ch_2Lqdeuig6peNXzgD0sA3iBuH,,2022-10-31 10:30:10,usd,,,,,,,,,,,2022-11-26 23:59:59.000000 UTC,false,false,0,,,,,,,,,,,,,,,,,,false,true,,subscription_canceled,lost
du_0LiAl6ig6peNXzgDEejs24CE,2022-11-13 20:20:09,432532,txn_0Lumheig6peNXzgDSp1KIXph,ch_2LVoJuig6peNXzgD1DvyohjD,,2022-09-15 05:37:08,usd,,,,,,,,,,,2022-11-12 23:59:59.000000 UTC,false,false,0,,,,,,,,,,,,,,,,,,false,true,,general,lost
du_0M9ScVig6peNXzgDkfd7tUNb,2022-12-12 20:19:03,1400,txn_0M9SdPig6peNXzgDgpb4aJDQ,ch_2LqcRzig6peNXzgD06FImTqU,,2022-11-29 12:09:03,usd,,,,,,,,,,,2022-12-25 23:59:59.000000 UTC,false,false,0,,,,,,,,,,,,,,,,,,false,true,,subscription_canceled,lost
du_0LuGd7ig6peNXzgDUxXx85wF,2022-11-14 14:21:25,1400,txn_0LuGe5ig6peNXzgD7PMfTzJ6,ch_2LfkHjig6peNXzgD1e9ltqQt,,2022-10-18 14:18:53,usd,,,,,,,,,,,2022-11-13 23:59:59.000000 UTC,false,false,0,,,,,,,,,,,,,,,,,,false,true,,subscription_canceled,lost
du_0LuGbbig6peNXzgDjHA4RfoT,2022-11-14 14:21:25,700,txn_0LuGcrig6peNXzgDKP5y95T9,ch_2LLwgKig6peNXzgD0Sr5X6kL,,2022-10-18 14:17:19,usd,,,,,,,,,,,2022-11-13 23:59:59.000000 UTC,false,false,0,,,,,,,,,,,,,,,,,,false,true,,subscription_canceled,lost
11 changes: 11 additions & 0 deletions integration_tests/seeds/transfer_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
id,_fivetran_synced,amount,amount_reversed,balance_transaction_id,created,currency,description,destination,destination_payment,destination_payment_id,livemode,metadata,reversed,source_transaction,source_transaction_id,source_type,transfer_group
po_0Njtvzig6peNXzgD6RPBasht,2023-08-29 02:19:08,1447318,0,txn_0Njtw0ig6peNXzgDXY3mJGwC,2023-08-28 01:08:03,usd,STRIPE PAYOUT,ba_0MkB7Nig6peNXzgDBFL0SIgk,,,true,"""{""netsuite_deposit_id"":""3975560"",""netsuite_deposit_link"":""https://en.wikipedia.org/wiki/Beyonc%C3%A9""}""",false,,,card,
po_0NjXKxig6peNXzgDgn8MqQuZ,2023-08-28 08:20:02,2660278,0,txn_0NjXKyig6peNXzgDbmNVE84K,2023-08-27 01:00:19,usd,STRIPE PAYOUT,ba_0MkB7Nig6peNXzgDBFL0SIgk,,,true,,false,,,card,
po_0NkGNTig6peNXzgDJWfkSimX,2023-08-30 02:19:14,760313,0,txn_0NkGNTig6peNXzgDTsXXisyE,2023-08-29 01:05:55,usd,STRIPE PAYOUT,ba_0MkB7Nig6peNXzgDBFL0SIgk,,,true,,false,,,card,
po_0NkcrHig6peNXzgDwoDFU4Yi,2023-08-30 02:19:14,1944407,0,txn_0NkcrHig6peNXzgD7eFO2jc7,2023-08-30 01:06:11,usd,STRIPE PAYOUT,ba_0MkB7Nig6peNXzgDBFL0SIgk,,,true,,false,,,card,
po_0Mbvvvig6peNXzgDNH6Wf3ha,2023-02-17 01:15:32,7251977,0,txn_0Mbvvvig6peNXzgDJAGJCdpN,2023-02-16 01:06:47,usd,STRIPE PAYOUT,ba_1S2vcDBpbM03IU,,,true,,false,,,card,
po_0LunJvig6peNXzgD41QBrw1m,2022-10-21 08:21:56,-1426166,0,txn_0LunJwig6peNXzgDCnBflWPl,2022-10-20 01:13:15,usd,STRIPE PAYOUT,ba_1S2vcDBpbM03IU,,,true,,false,,,card,
po_0MRQ1gig6peNXzgD138jhQS7,2023-01-19 02:19:35,7332491,0,txn_0MRQ1gig6peNXzgDchKTwIPQ,2023-01-18 01:01:16,usd,STRIPE PAYOUT,ba_1S2vcDBpbM03IU,,,true,,false,,,card,
po_0MRmW1ig6peNXzgDUPQSnmYw,2023-01-20 02:19:18,6108653,0,txn_0MRmW1ig6peNXzgDFqR0yaFa,2023-01-19 01:02:05,usd,STRIPE PAYOUT,ba_1S2vcDBpbM03IU,,,true,,false,,,card,
po_0MJ5C6ig6peNXzgDyic22YlD,2022-12-27 02:19:05,3456033,0,txn_0MJ5C7ig6peNXzgDfWTszRUw,2022-12-26 01:09:34,usd,STRIPE PAYOUT,ba_1S2vcDBpbM03IU,,,true,,false,,,card,
po_0MDe3Sig6peNXzgDJHinDGmA,2022-12-12 02:18:56,3330213,0,txn_0MDe3Tig6peNXzgDSyxtRpRH,2022-12-11 01:10:10,usd,STRIPE PAYOUT,ba_1S2vcDBpbM03IU,,,true,,false,,,card,
2 changes: 1 addition & 1 deletion models/docs.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{% docs source_relation -%} The source where this data was pulled from. If you are making use of the `union_schemas` variable, this will be the source schema. If you are making use of the `union_databases` variable, this will be the source database. If you are not unioning together multiple sources, this will be an empty string.
{%- enddocs %}
{%- enddocs %}
52 changes: 26 additions & 26 deletions models/intermediate/int_stripe__account_daily.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ with date_spine as (

select *,
case
when type = 'payout'
then {{ date_timezone('available_on') }}
else {{ date_timezone('created_at') }}
when balance_transaction_type = 'payout'
then {{ date_timezone('balance_transaction_available_on') }}
else {{ date_timezone('balance_transaction_created_at') }}
end as date
from {{ ref('stripe__balance_transactions') }}

Expand All @@ -24,41 +24,41 @@ with date_spine as (
date_spine.date_day,
date_spine.account_id,
date_spine.source_relation,
sum(case when balance_transaction.type in ('charge', 'payment')
then balance_transaction.amount
sum(case when balance_transaction.balance_transaction_type in ('charge', 'payment')
then balance_transaction.balance_transaction_amount
else 0 end) as total_daily_sales_amount,
sum(case when balance_transaction.type in ('payment_refund', 'refund')
then balance_transaction.amount
sum(case when balance_transaction.balance_transaction_type in ('payment_refund', 'refund')
then balance_transaction.balance_transaction_amount
else 0 end) as total_daily_refunds_amount,
sum(case when balance_transaction.type = 'adjustment'
then balance_transaction.amount
sum(case when balance_transaction.balance_transaction_type = 'adjustment'
then balance_transaction.balance_transaction_amount
else 0 end) as total_daily_adjustments_amount,
sum(case when balance_transaction.type not in ('charge', 'payment', 'payment_refund', 'refund', 'adjustment', 'payout') and balance_transaction.type not like '%transfer%'
then balance_transaction.amount
sum(case when balance_transaction.balance_transaction_type not in ('charge', 'payment', 'payment_refund', 'refund', 'adjustment', 'payout') and balance_transaction.balance_transaction_type not like '%transfer%'
then balance_transaction.balance_transaction_amount
else 0 end) as total_daily_other_transactions_amount,
sum(case when balance_transaction.type <> 'payout' and balance_transaction.type not like '%transfer%'
then balance_transaction.amount
sum(case when balance_transaction.balance_transaction_type <> 'payout' and balance_transaction.balance_transaction_type not like '%transfer%'
then balance_transaction.balance_transaction_amount
else 0 end) as total_daily_gross_transaction_amount,
sum(case when balance_transaction.type <> 'payout' and balance_transaction.type not like '%transfer%'
then net
sum(case when balance_transaction.balance_transaction_type <> 'payout' and balance_transaction.balance_transaction_type not like '%transfer%'
then balance_transaction_net
else 0 end) as total_daily_net_transactions_amount,
sum(case when balance_transaction.type = 'payout' or balance_transaction.type like '%transfer%'
then fee * -1.0
sum(case when balance_transaction.balance_transaction_type = 'payout' or balance_transaction.balance_transaction_type like '%transfer%'
then balance_transaction_fee * -1.0
else 0 end) as total_daily_payout_fee_amount,
sum(case when balance_transaction.type = 'payout' or balance_transaction.type like '%transfer%'
then balance_transaction.amount
sum(case when balance_transaction.balance_transaction_type = 'payout' or balance_transaction.balance_transaction_type like '%transfer%'
then balance_transaction.balance_transaction_amount
else 0 end) as total_daily_gross_payout_amount,
sum(case when balance_transaction.type = 'payout' or balance_transaction.type like '%transfer%'
then fee * -1.0
else net end) as daily_net_activity_amount,
sum(case when balance_transaction.type in ('payment', 'charge')
sum(case when balance_transaction.balance_transaction_type = 'payout' or balance_transaction.balance_transaction_type like '%transfer%'
then balance_transaction_fee * -1.0
else balance_transaction_net end) as daily_net_activity_amount,
sum(case when balance_transaction.balance_transaction_type in ('payment', 'charge')
then 1
else 0 end) as total_daily_sales_count,
sum(case when balance_transaction.type = 'payout'
sum(case when balance_transaction.balance_transaction_type = 'payout'
then 1
else 0 end) as total_daily_payouts_count,
count(distinct case when balance_transaction.type = 'adjustment'
then coalesce(source, payout_id)
count(distinct case when balance_transaction.balance_transaction_type = 'adjustment'
then coalesce(source_id, payout_id)
else null end) as total_daily_adjustments_count
from date_spine
left join balance_transaction
Expand Down
4 changes: 2 additions & 2 deletions models/intermediate/int_stripe__date_spine.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ with spine as (

{% if execute %}
{% set first_date_query %}
select min( created_at ) as min_date from {{ ref('stripe__balance_transactions') }}
select min( balance_transaction_created_at ) as min_date from {{ ref('stripe__balance_transactions') }}
{% endset %}
{% set first_date = run_query(first_date_query).columns[0][0]|string %}

Expand All @@ -20,7 +20,7 @@ with spine as (

{% if execute %}
{% set last_date_query %}
select max( created_at ) as max_date from {{ ref('stripe__balance_transactions') }}
select max( balance_transaction_created_at ) as max_date from {{ ref('stripe__balance_transactions') }}
{% endset %}

{% set current_date_query %}
Expand Down
Loading