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

stg_stripe__subscription #48

Closed lijol closed 1 year ago

lijol commented 1 year ago

Is there an existing issue for this?

Describe the issue

The model is still using stg_stripe__subscription. This is throwing error as the table doesn't not exist . It has been changed to stg_stripe__subscription_history

Relevant error log or model output

STRIPE.SUBSCRIPTION' does not exist or not authorized.

Expected behavior

The model is expected to run fine

dbt Project configurations

stripe_database: FIVETRAN_DB stripe_schema: STRIPE

Package versions

0.7.2

What database are you using dbt with?

snowflake

dbt Version

1.1.1

Additional Context

No response

Are you willing to open a PR to help address this issue?

fivetran-joemarkiewicz commented 1 year ago

Hi @lijol thanks for raising this issue!

It looks like this is a compilation error where the package is looking for the subscription source table; however, I imagine you have the subscription_history source table instead. I also noticed you did not have any additional variables declared other than the schema and database variables for the stripe package.

If the above is the case, you may need to add a new variable to have the package reference the history models instead of the non-historical tables (which it seems you do not have). You can see more details on this configurability within the package README.

You should be able to add the below config to your root dbt_project.yml and see the package work succesfully:

vars:
    stripe__subscription_history: True

Let me know if this does the trick!

lijol commented 1 year ago

Added the variable but same error

stripe_database: FIVETRAN_DB stripe_schema: STRIPE stripe__subscription_history: True

image

lijol commented 1 year ago

As the subscription table is deprecated, isn't it better to have model with subscription _history ?

fivetran-joemarkiewicz commented 1 year ago

Hi @lijol the model name is actually stg_stripe__subscription (although with the variable it will pull from the history source, but will filter for the latest record). If you try dbt run -s +stg_stripe__subscription you should see success. Let me know!

Additionally, I agree that since the non history table has been deprecated it would make sense for the default of that variable to be true. However, I believe the deprecation is only for new connectors. Since we have a lot customers still on the older version of the connector, we don't want to break their runs. That being said, we are planning updates to our Stripe package next quarter and will be adjusting the default value of the variable during those next breaking changes!

lijol commented 1 year ago

thanks @fivetran-joemarkiewicz this worked.

by default making it true will be very helpful