fivetran / dbt_stripe_source

Fivetran's Stripe source dbt package
https://fivetran.github.io/dbt_stripe_source/
Apache License 2.0
8 stars 27 forks source link

Customer/sachams metadata add #28

Closed fivetran-joemarkiewicz closed 2 years ago

fivetran-joemarkiewicz commented 3 years ago

Are you a current Fivetran customer?

Fivetran created PR

What change(s) does this PR introduce?

This PR introduces the ability for users to pivot out the metadata field within the respective staging models for the following source tables: charge, invoice, payment_intent, payment_method, payout, plan, refund, and subscription. To configure the metadata fields to be pivoted out a user may configure the following variables:

# dbt_project.yml

vars:
    stripe__charge_metadata: ['the', 'list', 'of', 'property', 'fields'] # Note: this is case-SENSITIVE and must match the casing of the property as it appears in the JSON
    stripe__invoice_metadata: ['the', 'list', 'of', 'property', 'fields'] # Note: this is case-SENSITIVE and must match the casing of the property as it appears in the JSON
    stripe__payment_intent_metadata: ['the', 'list', 'of', 'property', 'fields'] # Note: this is case-SENSITIVE and must match the casing of the property as it appears in the JSON
    stripe__payment_method_metadata: ['the', 'list', 'of', 'property', 'fields'] # Note: this is case-SENSITIVE and must match the casing of the property as it appears in the JSON
    stripe__payout_metadata: ['the', 'list', 'of', 'property', 'fields'] # Note: this is case-SENSITIVE and must match the casing of the property as it appears in the JSON
    stripe__plan_metadata: ['the', 'list', 'of', 'property', 'fields'] # Note: this is case-SENSITIVE and must match the casing of the property as it appears in the JSON
    stripe__refund_metadata: ['the', 'list', 'of', 'property', 'fields'] # Note: this is case-SENSITIVE and must match the casing of the property as it appears in the JSON
    stripe__subscription_metadata: ['the', 'list', 'of', 'property', 'fields'] # Note: this is case-SENSITIVE and must match the casing of the property as it appears in the JSON

Does this PR introduce a breaking change?

This metadata pivot will be disabled by default and will not introduce a breaking change for existing stripe users.

Is this PR in response to a previously created Issue

How did you test the PR changes?

- [X] CircleCi - [ ] Other (please provide additional testing details below) **Select which warehouse(s) were used to test the PR** - [X] BigQuery - [X] Redshift - [X] Snowflake - [ ] Postgres - [ ] Databricks - [ ] Other (provide details below) **Provide an emoji that best describes your current mood** 🤘 **Feedback** We are so excited you decided to contribute to the Fivetran community dbt package! We continue to work to improve the packages and would greatly appreciate your [feedback](https://www.surveymonkey.com/r/DQ7K7WW) on our existing dbt packages or what you'd like to see next.
fivetran-joemarkiewicz commented 3 years ago

@sachams and @mnahkies for visibility.