Skip to content

Commit

Permalink
Merge pull request #19 from fivetran/MagicBot_eee0a78196
Browse files Browse the repository at this point in the history
[MagicBot] Bumping package version
  • Loading branch information
fivetran-joemarkiewicz authored Jul 28, 2021
2 parents cb6edfe + 10998c1 commit 197a57d
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 58 deletions.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- run:
name: "Setup dbt"
command: |
sudo apt install libsasl2-dev
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip setuptools
Expand Down Expand Up @@ -60,4 +61,4 @@ jobs:
- save_cache:
key: deps2-{{ .Branch }}
paths:
- "venv"
- "venv"
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![Apache License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![dbt logo and version](https://img.shields.io/static/v1?logo=dbt&label=dbt-version&message=0.20.x&color=orange)
# Stripe

This package models Stripe data from [Fivetran's connector](https://fivetran.com/docs/applications/stripe). It uses data in the format described by [this ERD](https://fivetran.com/docs/applications/stripe#schemainformation).
Expand All @@ -22,7 +23,15 @@ This package contains transformation models, designed to work simultaneously wit

## Installation Instructions

Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions, or [read the docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages.
Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions, or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages.

Include in your `packages.yml`

```yaml
packages:
- package: fivetran/stripe
version: [">=0.5.0", "<0.6.0"]
```
## Configuration
Expand Down
60 changes: 25 additions & 35 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
config-version: 2

name: 'stripe'
version: '0.4.2'

require-dbt-version: [">=0.18.0", "<0.20.0"]

version: '0.5.0'
require-dbt-version: [">=0.20.0"]
models:
stripe:
+schema: stripe
+materialized: table
intermediate:
+materialized: ephemeral

stripe:
+schema: stripe
+materialized: table
intermediate:
+materialized: ephemeral
vars:
stripe:
balance_transaction: "{{ ref('stg_stripe__balance_transaction') }}"
card: "{{ ref('stg_stripe__card') }}"
charge: "{{ ref('stg_stripe__charge') }}"
customer: "{{ ref('stg_stripe__customer') }}"
fee: "{{ ref('stg_stripe__fee') }}"
invoice: "{{ ref('stg_stripe__invoice') }}"
invoice_line_item: "{{ ref('stg_stripe__invoice_line_item') }}"
payment_intent: "{{ ref('stg_stripe__payment_intent') }}"
payment_method_card: "{{ ref('stg_stripe__payment_method_card') }}"
payment_method: "{{ ref('stg_stripe__payment_method') }}"
payout: "{{ ref('stg_stripe__payout') }}"
plan: "{{ ref('stg_stripe__plan') }}"
refund: "{{ ref('stg_stripe__refund') }}"
subscription: "{{ ref('stg_stripe__subscription') }}"

#Variables to enable or disable models if you do not have the respective table.
using_invoices: True
using_payment_method: True
using_subscriptions: True

dbt_utils_dispatch_list:
- fivetran_utils
- dbt_utils
stripe:
balance_transaction: "{{ ref('stg_stripe__balance_transaction') }}"
card: "{{ ref('stg_stripe__card') }}"
charge: "{{ ref('stg_stripe__charge') }}"
customer: "{{ ref('stg_stripe__customer') }}"
fee: "{{ ref('stg_stripe__fee') }}"
invoice: "{{ ref('stg_stripe__invoice') }}"
invoice_line_item: "{{ ref('stg_stripe__invoice_line_item') }}"
payment_intent: "{{ ref('stg_stripe__payment_intent') }}"
payment_method_card: "{{ ref('stg_stripe__payment_method_card') }}"
payment_method: "{{ ref('stg_stripe__payment_method') }}"
payout: "{{ ref('stg_stripe__payout') }}"
plan: "{{ ref('stg_stripe__plan') }}"
refund: "{{ ref('stg_stripe__refund') }}"
subscription: "{{ ref('stg_stripe__subscription') }}"
using_invoices: true
using_payment_method: true
using_subscriptions: true
23 changes: 5 additions & 18 deletions integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
config-version: 2

name: 'stripe_integration_tests'
version: '0.4.2'

require-dbt-version: [">=0.18.0", "<0.20.0"]
version: '0.5.0'
profile: 'integration_tests'

vars:
Expand Down Expand Up @@ -42,30 +40,19 @@ vars:
subscription: "{{ ref('subscription_data') }}"

seeds:
+quote_columns: "{{ true if target.type == 'redshift' else false }}"
stripe_integration_tests:
+quote_columns: "{{ true if target.type == 'redshift' else false }}"
+column_types:
_fivetran_synced: timestamp
group_data:
balance_transaction_data:
+column_types:
created: timestamp
available_on: timestamp
card_data:
charge_data:
+column_types:
balance_transaction_id: "{{ 'varchar(250)' if target.type == 'redshift' else 'string'}}"
balance_transaction_id: "{{ 'varchar(250)' if target.type == 'redshift' else 'string'}}"
created: timestamp
customer_data:
+column_types:
description: "{{ 'varchar(500)' if target.type == 'redshift' else 'string'}}"
fee_data:
invoice_data:
invoice_line_item_data:
payment_intent_data:
payment_method_card_data:
payment_method_data:
payout_data:
plan_data:
refund_data:
subscription_data:
description: "{{ 'varchar(500)' if target.type == 'redshift' else 'string'}}"

4 changes: 3 additions & 1 deletion integration_tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
dbt==0.19.0
dbt==0.20.0
dbt-spark==0.20.0
dbt-spark[PyHive]==0.20.0
2 changes: 1 addition & 1 deletion macros/date_timezone.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro date_timezone(column) -%}

{{ adapter.dispatch('date_timezone', packages=fivetran_utils._get_utils_namespaces()+['stripe'])(column) }}
{{ adapter.dispatch('date_timezone', 'stripe')(column) }}

{%- endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion packages.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
packages:
- package: fivetran/stripe_source
version: [">=0.3.0", "<0.4.0"]
version: [">=0.4.0", "<0.5.0"]

0 comments on commit 197a57d

Please sign in to comment.