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

Config livemode #22

Merged
merged 20 commits into from
Aug 13, 2021
Merged

Config livemode #22

merged 20 commits into from
Aug 13, 2021

Conversation

fivetran-jamie
Copy link
Contributor

What change(s) does this PR introduce?

Allows users to potentially include testing/non-live customer data (for testing purposes)

Does this PR introduce a breaking change?

  • Yes (please provide breaking change details below.)
  • No (please provide explanation how the change is non breaking below.)

Is this PR in response to a previously created Issue

How did you test the PR changes?

  • CircleCi
  • Other (please provide additional testing details below) directly in bigquery

Select which warehouse(s) were used to test the PR

  • BigQuery
  • Redshift
  • 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 on our existing dbt packages or what you'd like to see next.

Copy link
Contributor

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

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

Your solution works great, but I think we need to gain more context from the customer in order to move forward with this PR. The customer responded to their Issue #19 saying they want to see their test customers next to live customers. I am suspicious to think that a test customer will not be tied to livemode invoices, payments, charges, etc. If a test customer is also tied to other test objects then we will need to add this functionality to all other tables that allow the livemode feature.

Our next steps for this enhancement would be to go back to the customer and ask if this solution is sufficient for their request, or if we will want to apply a blanket exclude_test variable that allows users to enable or disable the livemode functionality across the entire package. We will then want to determine if the customer is intending for any of these changes to be replicated in downstream models. I just did a quick check and notice we have no is_livemode fields so it would be impossible to determine in aggregates which records are test and which are not within the transform package.

Copy link
Contributor

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

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

Looks good! I just had one comment we should look into before release regarding the naming of livemode within invoice_line_item

README.md Outdated
@@ -71,7 +73,18 @@ models:

*Read more about using custom schemas in dbt [here](https://docs.getdbt.com/docs/building-a-dbt-project/building-models/using-custom-schemas).*

### Contributions ###
### Running on Live vs Test Customers
By default, this package will run on non-test data (`where livemode = true`) from the source Stripe tables. However, you may want to include and focus on test data when testing out the package or developing your analyses. To run on _only_ test data, add the following configuration to your `dbt_project.yml` file:
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you intend for _only_ to have the underscores?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i did at the time but maybe i should just remove...

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I like it italicized, but let's remove the underscores.

@@ -2,3 +2,5 @@

select *
from {{ var('invoice_line_item') }}

{{ livemode_predicate() }}
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like our ERD shows livemode as live_mode. Let's confirm with the PM wha is accurate here and if we should make an adjustment to the ERD.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah pretty sure the ERD is incorrect -- we've been using livemode in the columns macro

Copy link
Contributor

Choose a reason for hiding this comment

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

Good call! Looks good then!

@fivetran-jamie fivetran-jamie merged commit 5378606 into master Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants