PR #87 includes the following updates:
Stripe passes amount-based fields, such as amount
, net
, and fee
, in the smallest denomination as raw form. This means, if your currency has minor and major units such as USD, 100 represents 100 cents, the minor unit, or 1 USD, the major unit. Alternatively, if your currency doesn't use minor units such as JPY, 100 represents 100 JPY.
- This PR introduces a variable
stripe__convert_values
(false
by default) which allows users the option to divide all amount-based fields by 100.- For information on how to enable the division, refer to the README on configuring the
stripe__convert_values
variable. - Otherwise, amount-based fields will be brought through in their raw form.
- Examples of currencies using minor units (in which enabling
stripe__convert_values
is relevant) include United States Dollar (USD), Euro (EUR), and the Canadian Dollar (CAD). - Examples of currencies NOT using minor units (in which it makes more sense to keep the amount-based fields in raw form) include Japanese Yen (JPY), Indonesian Rupiah (IDR), and Korean Won (KRW).
- For information on how to enable the division, refer to the README on configuring the
- Introduces the
convert_values
macro which contains the logic for enabling the division by 100, referenced by all amount-based fields. - Updates the
run_models.sh
script to test for whenstripe__convert_values
is set to True.
- This update is not providing multiple currency support; however, we're interested in exploring this functionality if there's a need. As such, we have created a feature request to support multiple currencies where you are welcome to provide feedback or contribute to the discussion.
- Updates the descriptions for all amount-based fields to specify the grain of the values and add information about the
stripe__convert_values
variable. - Corrected references to connectors and connections in the README. (#88)
- Declaration of passthrough variables for the
stg_stripe__card
model. This can, for example, be used to pull in non-standard columns from Stripe such asdescription
,iin
andissuer
. See the README for more details (PR #81).
# dbt_project.yml
vars:
stripe_source:
card_pass_through_columns:
- name: "description"
- name: "iin"
- name: "issuer"
alias: "card_issuer" # optional: define an alias for the column
transform_sql: "cast(card_issuer as string)" # optional: apply transformation to column. must reference the alias if provided
- Removed un-used columns from the
get_card_columns()
macro and aliased themetadata
field, which is parsed via thestripe__card_metadata
variable, but not included as a field in its entirety instg_stripe__card
by default (PR #83).- This ensures users can utilize the new
card_pass_through_columns
variable to include these fields instg_stripe__card
.
- This ensures users can utilize the new
[PR #77] includes the following updates:
- Addition of the following new staging models and accompanying upstream references:
stg_stripe__discount
(required for downstreamdbt_stripe
model transformations)stg_stripe__product
(enabled by default, but can be disabled by setting thestripe__using_subscriptions
variable tofalse
)
[PR #74] includes the following updates:
- Removes the
unique_invoice_line_item_id
uniqueness test instg_stripe__invoice_line_item
. This is becauseunique_invoice_line_item_id
(unique_id
in the raw sourceinvoice_line_item
table) was part of an older version of Stripe that was brought forth to help migrate internal references. See the Stripe API update for more information. The Fivetran connector persists this in order to resolve the pagination break issue for invoice line items that was introduced by the API update.- Furthermore the column definition for
unique_invoice_line_item_id
(unique_id
in the raw sourceinvoice_line_item
table) has been made more specific:"A unique id generated and only for old invoice line item ID's from a past version of the API. The introduction of this field resolves the pagination break issue for invoice line items, which was introduced by the Stripe API update."
- Furthermore the column definition for
PR #72 includes the following updates:
- No longer filters out deleted customers in
stg_stripe__customer
.- Persists
is_deleted
field to differentiate between deleted and active customers. - Note that this is a π¨ breaking change π¨, as previously filtered-out records will appear in
stg_stripe__customer
(and the downstream transformstripe__customer_overview
model).
- Persists
- Adds the
phone
column tostg_stripe__customer
.
- Included auto-releaser GitHub Actions workflow to automate future releases.
- Updated the maintainer PR template to resemble the most up to date format.
PR #68 includes the following updates:
- Adds the
dispute
andtransfer
objects and respective staging models.
v0.9.3 includes the following updates:
- PR #67 moves the live_mode predicate to the non *_tmp staging models.
- This move is necessary due to the 0.4.3 release of fivetran_utils, which infers if the source table a package is present, and if not the package will create an empty table to ensure the downstream transformations succeed. Previously the Stripe package wasn't compatible because of where the live_mode predicate existed. In the case there will be an empty data model created, we needed to move the predicate so that the queries and downstream models will still run correctly.
- PR #66 incorporates the new
fivetran_utils.drop_schemas_automation
macro into the end of each Buildkite integration test job and updates the pull request templates.
PR #64 includes the following updates:
- The
stg_stripe__fee
uniqueness test has been updated to also consider theindex
when determining the unique combination of columns. As there may be many indexes to a single fee, the uniqueness test has been updated to account for this scenario.
PR #61 includes the following updates:
- Included the metadata pivot functionality for the
card
andinvoice_line_item
staging models using the respectivestripe__card_metadata
andstripe__invoice_line_item_metadata
variables.
PR #59 contains the following changes:
- Variable names have been updated to contain the
stripe
prefix, allowing you to configure global variables while only affecting the Stripe package.
Previous Name | New Name |
---|---|
using_invoices | stripe__using_invoices |
using_credit_notes | stripe__using_credit_notes |
using_payment_method | stripe__using_payment_method |
using_livemode | stripe__using_livemode |
using_invoice_line_sub_filter | stripe__using_invoice_line_sub_filter |
using_subscriptions | stripe__using_subscriptions |
using_subscription_history | stripe__using_subscription_history |
stg_stripe__plan
has been changed tostg_stripe__price_plan
. Following Stripe's migration from thePlan
object to thePrice
object (Stripe doc here.), we have added a new variablestripe__using_price
and macrodoes_table_exist
that checks if theprice
table exists. This package usesprice
by default if it exists. However, if you still have and wish to keep usingplan
, you can setstripe__using_price
to False. For more please see the READMEstripe__plan_metadata
variable has been renamed tostripe__price_plan_metadata
- Stripe connectors set up after February 09, 2022 will use the
subscription_history
table, as they will no longer be syncing thesubscription
table. This package usessubscription_history
by default if it exists. However, if you still have thesubscription
table and wish to use it instead, then set thestripe__using_subscription_history
to False.
- Added the Union ability to allow for multiple Stripe connectors. The new
source_relation
column in each staging model will specify where each record comes from. For more information please see the README #33 - Added new
price
source table in addition to newstripe__using_price
variable. Stripe migrated the Plan API to Price API (for more information, refer to their docs) so we recommend using the price table. Thestripe__using_price
variable anddoes_table_exist
macro checks to see if you are indeed using theprice
table. If you plan on using theplan
table instead you may toggle this to False. For more information on how to configure, refer to the README. - Added additional fields to the following models:
stg_stripe__charge
,stg_stripe__invoice
,stg_stripe__invoice_line_item
,stg_stripe__payment_method_card
,stg_stripe__refund
,stg_stripe__subscription
.
For more please see the README
PR #52 includes the following breaking changes:
- Dispatch update for dbt-utils to dbt-core cross-db macros migration. Specifically
{{ dbt_utils.<macro> }}
have been updated to{{ dbt.<macro> }}
for the below macros:any_value
bool_or
cast_bool_to_text
concat
date_trunc
dateadd
datediff
escape_single_quotes
except
hash
intersect
last_day
length
listagg
position
replace
right
safe_cast
split_part
string_literal
type_bigint
type_float
type_int
type_numeric
type_string
type_timestamp
array_append
array_concat
array_construct
- For
current_timestamp
andcurrent_timestamp_in_utc
macros, the dispatch AND the macro names have been updated to the below, respectively:dbt.current_timestamp_backcompat
dbt.current_timestamp_in_utc_backcompat
dbt_utils.surrogate_key
has also been updated todbt_utils.generate_surrogate_key
. Since the method for creating surrogate keys differ, we suggest all users do afull-refresh
for the most accurate data. For more information, please refer to dbt-utils release notes for this update.- Dependencies on
fivetran/fivetran_utils
have been upgraded, previously[">=0.3.0", "<0.4.0"]
now[">=0.4.0", "<0.5.0"]
. - Updated README to include instructions on how to use metadata variable in cases of dictionary arguments. (#57)
- The
plan_interval
field within thestg_stripe__plan
model has been aliased within theget_plan_columns()
macro to allow for more flexibility across warehouses. (#58) - BuildKite testing has been added. (#58)
- The
period_start
andperiod_end
fields have been added to thestg_stripe__invoice
model. (#51)
- Databricks compatibility 𧱠(#47)
- Add timezone notation to timestamp column definition (#42)
- Addition of subscription ID in the
stg_stripe__invoice
model (#41)
- mvtemple (#43)
- ashishk-de (#44)
- Updated README documentation updates for easier navigation and setup of the dbt package
- Included
stripe_[source_table_name]_identifier
variable for additional flexibility within the package when source tables are named differently.
- Stripe connectors set up after February 09, 2022 no longer sync the
subscription
table; however, a newersubscription_history
table is synced. To account for this change a variablestripe__subscription_history
has been added to the package project to allow for users to define if their source contains thesubscription_history
table. (#37)- By default this variable is set to
false
. If you still have thesubscription
table, then there is no adjustment needed on your end. If you do have thesubscription_history
table then you will want to set the variable totrue
. - Similarly, if you have both tables, then I highly encourage you start leveraging the
subscription_history
source table in your package.
- By default this variable is set to
- Added Postgres support for the Stripe package (#39)
- Addresses a bug in which timestamp columns in the
balance_transaction
source table are brought in astimestamp with time zone
on Redshift and Postgres, which caused downstream datatype errors. These columns are now always cast astimestamp without time zone
in the stagingbalance_transaction
model (#22).
π dbt v1.0.0 Compatibility π
- Adjusts the
require-dbt-version
to now be within the range [">=1.0.0", "<2.0.0"]. Additionally, the package has been updated for dbt v1.0.0 compatibility. If you are using a dbt version <1.0.0, you will need to upgrade in order to leverage the latest version of the package.- For help upgrading your package, I recommend reviewing this GitHub repo's Release Notes on what changes have been implemented since your last upgrade.
- For help upgrading your dbt project to dbt v1.0.0, I recommend reviewing dbt-labs upgrading to 1.0.0 docs for more details on what changes must be made.
- Upgrades the package dependency to refer to the latest
dbt_fivetran_utils
. The latestdbt_fivetran_utils
package also has a dependency ondbt_utils
[">=0.8.0", "<0.9.0"].- Please note, if you are installing a version of
dbt_utils
in yourpackages.yml
that is not in the range above then you will encounter a package dependency error.
- Please note, if you are installing a version of
- Add customer metadata to the
stg_stripe__customer
model.
- Allow metadata passthrough functionality for the customer staging model. Please see the README for more details on how to pivot out metadata properties. (#30)
Refer to the relevant release notes on the Github repository for specific details for the previous releases. Thank you!