Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# dbt_quickbooks v1.6.3
[PR #211](https://github.com/fivetran/dbt_quickbooks/pull/211) includes the following updates:

## Bug Fix
- Fixes Postgres/Redshift unknown datatype errors by explicitly casting string literals in our models as strings.

# dbt_quickbooks v1.6.2
[PR #207](https://github.com/fivetran/dbt_quickbooks/pull/207) includes the following updates:

Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config-version: 2
name: 'quickbooks'

version: '1.6.2'
version: '1.6.3'

require-dbt-version: [">=1.3.0", "<3.0.0"]

Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'quickbooks_integration_tests'

version: '1.6.2'
version: '1.6.3'

profile: 'integration_tests'
config-version: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ final as (
department_id,
created_at,
updated_at,
'debit' as transaction_type,
'bill' as transaction_source
cast('debit' as {{ dbt.type_string() }}) as transaction_type,
cast('bill' as {{ dbt.type_string() }}) as transaction_source
from bill_join

union all
Expand All @@ -96,8 +96,8 @@ final as (
department_id,
created_at,
updated_at,
'credit' as transaction_type,
'bill' as transaction_source
cast('credit' as {{ dbt.type_string() }}) as transaction_type,
cast('bill' as {{ dbt.type_string() }}) as transaction_source
from bill_join
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ final as (
department_id,
created_at,
updated_at,
'credit' as transaction_type,
'bill payment' as transaction_source
cast('credit' as {{ dbt.type_string() }}) as transaction_type,
cast('bill payment' as {{ dbt.type_string() }}) as transaction_source
from bill_payment_join

union all
Expand All @@ -99,8 +99,8 @@ final as (
department_id,
created_at,
updated_at,
'debit' as transaction_type,
'bill payment' as transaction_source
cast('debit' as {{ dbt.type_string() }}) as transaction_type,
cast('bill payment' as {{ dbt.type_string() }}) as transaction_source
from bill_payment_join
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ final as (
department_id,
created_at,
updated_at,
'credit' as transaction_type,
'credit card payment' as transaction_source
cast('credit' as {{ dbt.type_string() }}) as transaction_type,
cast('credit card payment' as {{ dbt.type_string() }}) as transaction_source
from credit_card_payment_prep

union all
Expand All @@ -73,8 +73,8 @@ final as (
department_id,
created_at,
updated_at,
'debit' as transaction_type,
'credit card payment' as transaction_source
cast('debit' as {{ dbt.type_string() }}) as transaction_type,
cast('credit card payment' as {{ dbt.type_string() }}) as transaction_source
from credit_card_payment_prep
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ final as (
department_id,
created_at,
updated_at,
'credit' as transaction_type,
'credit_memo' as transaction_source
cast('credit' as {{ dbt.type_string() }}) as transaction_type,
cast('credit_memo' as {{ dbt.type_string() }}) as transaction_source
from credit_memo_join

union all
Expand All @@ -112,8 +112,8 @@ final as (
department_id,
created_at,
updated_at,
'debit' as transaction_type,
'credit_memo' as transaction_source
cast('debit' as {{ dbt.type_string() }}) as transaction_type,
cast('credit_memo' as {{ dbt.type_string() }}) as transaction_source
from credit_memo_join

left join df_accounts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ final as (
department_id,
created_at,
updated_at,
'debit' as transaction_type,
'deposit' as transaction_source
cast('debit' as {{ dbt.type_string() }}) as transaction_type,
cast('deposit' as {{ dbt.type_string() }}) as transaction_source
from deposit_join

union all
Expand All @@ -104,8 +104,8 @@ final as (
department_id,
created_at,
updated_at,
'credit' as transaction_type,
'deposit' as transaction_source
cast('credit' as {{ dbt.type_string() }}) as transaction_type,
cast('deposit' as {{ dbt.type_string() }}) as transaction_source
from deposit_join
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@ invoice_join as (
then 1
else coalesce(invoices.exchange_rate, 1)
end) as converted_amount,
case when invoice_lines.detail_type is not null then invoice_lines.detail_type
cast(case when invoice_lines.detail_type is not null then invoice_lines.detail_type
when coalesce(invoice_bundles.account_id, invoice_lines.account_id, invoice_lines.sales_item_account_id, items.parent_income_account_id, items.income_account_id, bundle_income_accounts.account_id) is not null then 'SalesItemLineDetail'
when invoice_lines.discount_account_id is not null then 'DiscountLineDetail'
when coalesce(invoice_bundles.account_id, invoice_lines.account_id, invoice_lines.sales_item_account_id, items.parent_income_account_id, items.income_account_id, bundle_income_accounts.account_id, invoice_lines.discount_account_id) is null then 'NoAccountMapping'
end as invoice_line_transaction_type,
end as {{ dbt.type_string() }}) as invoice_line_transaction_type,
coalesce(invoice_bundles.account_id, invoice_lines.account_id, invoice_lines.sales_item_account_id, items.parent_income_account_id, items.income_account_id, bundle_income_accounts.account_id, invoice_lines.discount_account_id) as account_id,
coalesce(invoice_bundles.class_id, invoice_lines.sales_item_class_id, invoice_lines.discount_class_id, invoices.class_id) as class_id,

Expand All @@ -238,11 +238,11 @@ invoice_join as (
then 1
else coalesce(invoices.exchange_rate, 1)
end) as converted_amount,
case when invoice_lines.detail_type is not null then invoice_lines.detail_type
cast(case when invoice_lines.detail_type is not null then invoice_lines.detail_type
when coalesce(invoice_lines.account_id, invoice_lines.sales_item_account_id, items.parent_income_account_id, items.income_account_id) is not null then 'SalesItemLineDetail'
when invoice_lines.discount_account_id is not null then 'DiscountLineDetail'
when coalesce(invoice_lines.account_id, invoice_lines.sales_item_account_id, items.parent_income_account_id, items.income_account_id, invoice_lines.discount_account_id) is null then 'NoAccountMapping'
end as invoice_line_transaction_type,
end as {{ dbt.type_string() }}) as invoice_line_transaction_type,
coalesce(invoice_lines.account_id, invoice_lines.sales_item_account_id, items.income_account_id, invoice_lines.discount_account_id) as account_id,
coalesce(invoice_lines.sales_item_class_id, invoice_lines.discount_class_id, invoices.class_id) as class_id,
{% endif %}
Expand Down Expand Up @@ -288,7 +288,7 @@ invoice_join as (
then 1
else coalesce(invoices.exchange_rate, 1)
end) as converted_amount,
'TaxLineDetail' as invoice_line_transaction_type,
cast('TaxLineDetail' as {{ dbt.type_string() }}) as invoice_line_transaction_type,
tax_account_join.account_id,
invoices.class_id,
invoices.customer_id,
Expand Down Expand Up @@ -340,12 +340,12 @@ final as (
department_id,
created_at,
updated_at,
case when invoice_line_transaction_type = 'DiscountLineDetail' then 'debit'
else 'credit'
end as transaction_type,
case when invoice_line_transaction_type = 'DiscountLineDetail' then 'invoice discount'
cast(case when invoice_line_transaction_type = 'DiscountLineDetail' then 'debit'
else 'credit'
end as {{ dbt.type_string() }}) as transaction_type,
cast(case when invoice_line_transaction_type = 'DiscountLineDetail' then 'invoice discount'
else 'invoice'
end as transaction_source
end as {{ dbt.type_string() }}) as transaction_source
from invoice_filter

union all
Expand All @@ -364,12 +364,12 @@ final as (
department_id,
created_at,
updated_at,
case when invoice_line_transaction_type = 'DiscountLineDetail' then 'credit'
else 'debit'
end as transaction_type,
case when invoice_line_transaction_type = 'DiscountLineDetail' then 'invoice discount'
cast(case when invoice_line_transaction_type = 'DiscountLineDetail' then 'credit'
else 'debit'
end as {{ dbt.type_string() }}) as transaction_type,
cast(case when invoice_line_transaction_type = 'DiscountLineDetail' then 'invoice discount'
else 'invoice'
end as transaction_source
end as {{ dbt.type_string() }}) as transaction_source
from invoice_filter

left join ar_accounts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ final as (
journal_entries.created_at,
journal_entries.updated_at,
lower(journal_entry_lines.posting_type) as transaction_type,
'journal_entry' as transaction_source
cast('journal_entry' as {{ dbt.type_string() }}) as transaction_source
from journal_entries

inner join journal_entry_lines
Expand Down Expand Up @@ -176,7 +176,7 @@ final as (
journal_entries.created_at,
journal_entries.updated_at,
cast(null as {{ dbt.type_string() }}) as transaction_type,
'journal_entry' as transaction_source
cast('journal_entry' as {{ dbt.type_string() }}) as transaction_source
from journal_entries

inner join journal_entry_tax_lines
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ final as (
cast(null as {{ dbt.type_string() }}) as department_id,
created_at,
updated_at,
'debit' as transaction_type,
'payment' as transaction_source
cast('debit' as {{ dbt.type_string() }}) as transaction_type,
cast('payment' as {{ dbt.type_string() }}) as transaction_source
from payment_join

union all
Expand All @@ -95,8 +95,8 @@ final as (
cast(null as {{ dbt.type_string() }}) as department_id,
created_at,
updated_at,
'credit' as transaction_type,
'payment' as transaction_source
cast('credit' as {{ dbt.type_string() }}) as transaction_type,
cast('payment' as {{ dbt.type_string() }}) as transaction_source
from payment_join

left join ar_accounts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ purchase_join as (
end as converted_amount,
coalesce(purchase_lines.account_expense_account_id, items.parent_expense_account_id, items.expense_account_id) as paid_to_account_id,
purchases.account_id as paid_from_account_id,
case when coalesce(purchases.credit, false) = true then 'debit' else 'credit' end as paid_from_transaction_type,
case when coalesce(purchases.credit, false) = true then 'credit' else 'debit' end as paid_to_transaction_type,
cast(case when coalesce(purchases.credit, false) = true then 'debit' else 'credit' end as {{ dbt.type_string() }}) as paid_from_transaction_type,
cast(case when coalesce(purchases.credit, false) = true then 'credit' else 'debit' end as {{ dbt.type_string() }}) as paid_to_transaction_type,
purchases.customer_id,
coalesce(purchase_lines.item_expense_class_id, purchase_lines.account_expense_class_id) as class_id,
purchases.vendor_id,
Expand Down Expand Up @@ -88,8 +88,8 @@ purchase_join as (
end as converted_amount,
coalesce(purchase_lines.account_expense_account_id, items.parent_expense_account_id, items.expense_account_id) as paid_to_account_id,
purchases.account_id as paid_from_account_id,
case when coalesce(purchases.credit, false) = true then 'debit' else 'credit' end as paid_from_transaction_type,
case when coalesce(purchases.credit, false) = true then 'credit' else 'debit' end as paid_to_transaction_type,
cast(case when coalesce(purchases.credit, false) = true then 'debit' else 'credit' end as {{ dbt.type_string() }}) as paid_from_transaction_type,
cast(case when coalesce(purchases.credit, false) = true then 'credit' else 'debit' end as {{ dbt.type_string() }}) as paid_to_transaction_type,
purchases.customer_id,
coalesce(purchase_lines.item_expense_class_id, purchase_lines.account_expense_class_id) as class_id,
purchases.vendor_id,
Expand Down Expand Up @@ -126,7 +126,7 @@ final as (
created_at,
updated_at,
paid_from_transaction_type as transaction_type,
'purchase' as transaction_source
cast('purchase' as {{ dbt.type_string() }}) as transaction_source
from purchase_join

union all
Expand All @@ -146,7 +146,7 @@ final as (
created_at,
updated_at,
paid_to_transaction_type as transaction_type,
'purchase' as transaction_source
cast('purchase' as {{ dbt.type_string() }}) as transaction_source
from purchase_join
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ final as (
department_id,
created_at,
updated_at,
'credit' as transaction_type,
'refund_receipt' as transaction_source
cast('credit' as {{ dbt.type_string() }}) as transaction_type,
cast('refund_receipt' as {{ dbt.type_string() }}) as transaction_source
from refund_receipt_join

union all
Expand All @@ -245,8 +245,8 @@ final as (
department_id,
created_at,
updated_at,
'debit' as transaction_type,
'refund_receipt' as transaction_source
cast('debit' as {{ dbt.type_string() }}) as transaction_type,
cast('refund_receipt' as {{ dbt.type_string() }}) as transaction_source
from refund_receipt_join
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ final as (
department_id,
created_at,
updated_at,
'debit' as transaction_type,
'sales_receipt' as transaction_source
cast('debit' as {{ dbt.type_string() }}) as transaction_type,
cast('sales_receipt' as {{ dbt.type_string() }}) as transaction_source
from sales_receipt_join

union all
Expand All @@ -250,8 +250,8 @@ final as (
department_id,
created_at,
updated_at,
'credit' as transaction_type,
'sales_receipt' as transaction_source
cast('credit' as {{ dbt.type_string() }}) as transaction_type,
cast('sales_receipt' as {{ dbt.type_string() }}) as transaction_source
from sales_receipt_join
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ final as (
cast(null as {{ dbt.type_string() }}) as department_id,
created_at,
updated_at,
'credit' as transaction_type,
'transfer' as transaction_source
cast('credit' as {{ dbt.type_string() }}) as transaction_type,
cast('transfer' as {{ dbt.type_string() }}) as transaction_source
from transfer_body

union all
Expand All @@ -68,8 +68,8 @@ final as (
cast(null as {{ dbt.type_string() }}) as department_id,
created_at,
updated_at,
'debit' as transaction_type,
'transfer' as transaction_source
cast('debit' as {{ dbt.type_string() }}) as transaction_type,
cast('transfer' as {{ dbt.type_string() }}) as transaction_source
from transfer_body
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ final as (
department_id,
created_at,
updated_at,
'credit' as transaction_type,
'vendor_credit' as transaction_source
cast('credit' as {{ dbt.type_string() }}) as transaction_type,
cast('vendor_credit' as {{ dbt.type_string() }}) as transaction_source
from vendor_credit_join

union all
Expand All @@ -96,8 +96,8 @@ final as (
department_id,
created_at,
updated_at,
'debit' as transaction_type,
'vendor_credit' as transaction_source
cast('debit' as {{ dbt.type_string() }}) as transaction_type,
cast('vendor_credit' as {{ dbt.type_string() }}) as transaction_source
from vendor_credit_join
)

Expand Down
Loading
Loading