Giter Club home page Giter Club logo

dbt_quickbooks_source's Introduction

QuickBooks Source dbt Package (Docs)

πŸ“– Table of Contents

πŸ“£ What does this dbt package do?

  • Materializes QuickBooks staging tables which leverage data in the format described by this ERD. These staging tables clean, test, and prepare your QuickBooks data from from Fivetran's connector for analysis by doing the following:
    • Name columns for consistency across all packages and for easier analysis.
    • Adds descriptions to tables and columns that are synced using Fivetran
    • Models staging tables, which will be used in our transform package.
    • Adds column-level testing where applicable. For example, all primary keys are tested for uniqueness and non-null values.
  • Generates a comprehensive data dictionary of your source and modeled QuickBooks data through the dbt docs site.
  • These tables are designed to work simultaneously with our QuickBooks transformation package

🎯 How do I use the dbt package?

Step 1: Prerequisites

To use this dbt package, you must have the following:

  • At least one Fivetran QuickBooks connector syncing data into your destination.
  • A BigQuery, Snowflake, Redshift, PostgreSQL, or Databricks destination.

Step 2: Install the package (skip if also using the quickbooks transformation package)

If you are not using the QuickBooks transformation package, include the following quickbooks_source package version in your packages.yml file.

TIP: Check dbt Hub for the latest installation instructions or read the dbt docs for more information on installing packages.

packages:
  - package: fivetran/quickbooks_source
    version: [">=0.9.0", "<0.10.0"] # we recommend using ranges to capture non-breaking changes automatically

Step 3: Define database and schema variables

By default, this package runs using your destination and the quickbooks schema of your target database. If this is not where your QuickBooks data is (for example, if your QuickBooks schema is named quickbooks_fivetran), add the following configuration to your root dbt_project.yml file:

vars:
    quickbooks_database: your_destination_name
    quickbooks_schema: your_schema_name 

Step 4: Enabling/Disabling Models

Your QuickBooks connector might not sync every table that this package expects. This package takes into consideration that not every QuickBooks account utilizes the same transactional tables.

By default, most variables' values are assumed to be true (with exception of using_purchase_order and using_credit_card_payment_txn). In other to enable or disable the relevant functionality in the package, you will need to add the relevant variables:

vars:
  using_address: false # disable if you don't have addresses in QuickBooks
  using_bill: false # disable if you don't have bills or bill payments in QuickBooks
  using_credit_memo: false # disable if you don't have credit memos in QuickBooks
  using_department: false # disable if you don't have departments in QuickBooks
  using_deposit: false # disable if you don't have deposits in QuickBooks
  using_estimate: false # disable if you don't have estimates in QuickBooks
  using_invoice: false # disable if you don't have estimates in QuickBooks
  using_invoice_bundle: false # disable if you don't have estimates in QuickBooks
  using_journal_entry: false # disable if you don't have estimates in QuickBooks
  using_payment: false # disable if you don't have estimates in QuickBooks
  using_refund_receipt: false # disable if you don't have estimates in QuickBooks
  using_transfer: false # disable if you don't have estimates in QuickBooks
  using_vendor_credit: false # disable if you don't have estimates in QuickBooks
  using_sales_receipt: false # disable if you don't have estimates in QuickBooks
  using_purchase_order: true # enable if you want to include purchase orders in your staging models
  using_credit_card_payment_txn: true # enable if you want to include credit card payment transactions in your staging models

(Optional) Step 5: Additional Configurations

Expand for configurations

Unioning Multiple QuickBooks Connectors

If you have multiple QuickBooks connectors in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. The package will union all of the data together and pass the unioned table into the transformations. You will be able to see which source it came from in the source_relation column of each model. To use this functionality, you will need to set either (note that you cannot use both) the quickbooks_union_schemas or quickbooks_union_databases variables:

# dbt_project.yml
...
config-version: 2
vars:
  quickbooks_union_schemas: ['quickbooks_us','quickbooks_ca'] # use this if the data is in different schemas/datasets of the same database/project
  quickbooks_union_databases: ['quickbooks_us','quickbooks_ca'] # use this if the data is in different databases/projects but uses the same schema name

Changing the Build Schema

By default this package will build the QuickBooks staging models within a schema titled (<target_schema> + _quickbooks_staging) in your target database. If this is not where you would like you QuickBooks staging data to be written to, add the following configuration to your dbt_project.yml file:

# dbt_project.yml

...
models:
    quickbooks_source:
        +schema: my_new_schema_name

Change the source table references

If an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable:

IMPORTANT: See this project's dbt_project.yml variable declarations to see the expected names.

vars:
    quickbooks_<default_source_table_name>_identifier: your_table_name 

(Optional) Step 6: Orchestrate your models with Fivetran Transformations for dbt Coreβ„’

Expand for details

Fivetran offers the ability for you to orchestrate your dbt project through Fivetran Transformations for dbt Coreβ„’. Learn how to set up your project for orchestration through Fivetran in our Transformations for dbt Core setup guides.

πŸ” Does this package have dependencies?

This dbt package is dependent on the following dbt packages. Please be aware that these dependencies are installed by default within this package. For more information on the following packages, refer to the dbt hub site.

IMPORTANT: If you have any of these dependent packages in your own packages.yml file, we highly recommend that you remove them from your root packages.yml to avoid package version conflicts.

packages:
    - package: fivetran/fivetran_utils
      version: [">=0.4.0", "<0.5.0"]

    - package: dbt-labs/dbt_utils
      version: [">=1.0.0", "<2.0.0"]

πŸ™Œ How is this package maintained and can I contribute?

Package Maintenance

The Fivetran team maintaining this package only maintains the latest version of the package. We highly recommend that you stay consistent with the latest version of the package and refer to the CHANGELOG and release notes for more information on changes across versions.

Contributions

A small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions!

We highly encourage and welcome contributions to this package. Check out this dbt Discourse article to learn how to contribute to a dbt package!

πŸͺ Are there any resources available?

  • If you have questions or want to reach out for help, please refer to the GitHub Issue section to find the right avenue of support for you.
  • If you would like to provide feedback to the dbt package team at Fivetran or would like to request a new dbt package, fill out our Feedback Form.
  • Have questions or want to be part of the community discourse? Create a post in the Fivetran community and our team along with the community can join in on the discussion!

dbt_quickbooks_source's People

Contributors

alex-ilyichov avatar fivetran-avinash avatar fivetran-catfritz avatar fivetran-jamie avatar fivetran-joemarkiewicz avatar fivetran-reneeli avatar fivetran-sheringuyen avatar jamesrayoub avatar jlmendgom5tran avatar kristin-bagnall avatar ligfx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dbt_quickbooks_source's Issues

[Feature] README Updates

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

This packages README is not currently inline with our existing standards. It would be ideal for this repo to see README updates to be in line with our current documentation guidelines.

Describe alternatives you've considered

No response

Are you interested in contributing this feature?

  • Yes.
  • Yes, but I will need assistance and will schedule time during your office hours for guidance.
  • No.

Anything else?

During these updates, we should also add the identifier variables and ensure the integration_tests/dbt_project.yml references the identifiers as well.

QUESTION - should "using_X" configuration be overridden by models: enabled: configuration in dbt_project.yml?

Are you a Fivetran customer?
Yes! - Ryan Aubrey, software engineer, Outlast

Your Question
Hi there! My company is using this package to manage our Quickbooks transformations in our data warehouse.

In Quickbooks, we do not use the Refund Receipt functionality - setting the environment variable using_receipt_refund works great to pass over the models dependent on refund receipts! Until we need to enable/disable the quickbooks models overall per dev/prod environment that is...

TLDR: using_X var is being overridden. Do you have any suggestions on how we can get the intended functionality?

  • Quickbooks disabled overall in all environments except for "prod"
  • Refund Receipts models always disabled

Context

vars:
  using_refund_receipt: false

models:
  quickbooks:
    enabled: "{{ (target.name == 'prod') | as_bool }}"

  quickbooks_source:
    enabled: "{{ (target.name == 'prod') | as_bool }}"

As you can see, we want to disable the refund receipt module always, as well as only ever enable quickbooks models in our "prod" environment. The above configuration gives precedence to the models>quickbooks>enabled: true when in our production environment.

This means that with the above configuration, when deploying our models to our production environment dbt still tries to deploy the models related to refund receipts.

Do you have any suggestions on how we can get the intended functionality?

  • Quickbooks disabled overall in all environments except for "prod"
  • Refund Receipts models always disabled

Solutions I tried

I tried disabling individual models, but the list is.. long :)

models:
  quickbooks:
    enabled: "{{ (target.name == 'prod') | as_bool }}"

  quickbooks_source:
    enabled: "{{ (target.name == 'prod') | as_bool }}"
     stg_quickbooks__refund_receipt_tmp:
       enabled: false
     stg_quickbooks__refund_receipt:
       enabled: false
    ...

Any help here is very much appreciated!

[Bug] dbt/quickbooks package breaking on build due to non-numerical sales_item_item_id

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

I'm having some trouble getting the Quickbooks dbt package running for a client of ours.

The problem seems to be that there is an ItemRef field in Quickbooks that is typically a numerical ID, but which is sometimes set to SHIPPING_ITEM_ID in some quickbook configurations. Fivetran correctly pulls it over to our Redshift, but the Quickbooks dbt_quickbooks_source package attempts to cast this ID to integer, causing it to crash.

Example: in dbt_packages/quickbooks_source/models/stg_quickbooks__credit_memo_line.sql the sales_item_item_id field seems to be populated by this ItemRef value, which makes all of my credit memo models fail.

Relevant error log or model output

13:45:03  Running with dbt=1.0.0
13:45:04  Found 103 models, 58 tests, 0 snapshots, 2 analyses, 509 macros, 0 operations, 0 seed files, 39 sources, 0 exposures, 0 metrics
13:45:04  
13:45:05  Concurrency: 4 threads (target='dev')
13:45:05  
13:45:05  1 of 76 START table model dbt.my_first_dbt_model................................ [RUN]
13:45:05  2 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__account_tmp..... [RUN]
13:45:05  3 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__address_tmp..... [RUN]
13:45:05  4 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__bill_line_tmp... [RUN]
13:45:07  4 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__bill_line_tmp [CREATE VIEW in 1.55s]
13:45:07  5 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__bill_linked_txn_tmp [RUN]
13:45:07  3 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__address_tmp [CREATE VIEW in 1.80s]
13:45:07  6 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__bill_payment_line_tmp [RUN]
13:45:08  1 of 76 OK created table model dbt.my_first_dbt_model........................... [SELECT in 2.15s]
13:45:08  7 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__bill_payment_tmp [RUN]
13:45:08  2 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__account_tmp [CREATE VIEW in 2.50s]
13:45:08  8 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__bill_tmp........ [RUN]
13:45:08  5 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__bill_linked_txn_tmp [CREATE VIEW in 1.23s]
13:45:08  9 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__bundle_item_tmp. [RUN]
13:45:09  6 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__bill_payment_line_tmp [CREATE VIEW in 1.42s]
13:45:09  10 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__bundle_tmp..... [RUN]
13:45:09  7 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__bill_payment_tmp [CREATE VIEW in 1.54s]
13:45:09  11 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__customer_tmp... [RUN]
13:45:10  8 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__bill_tmp... [CREATE VIEW in 1.71s]
13:45:10  12 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__department_tmp. [RUN]
13:45:10  9 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__bundle_item_tmp [CREATE VIEW in 1.87s]
13:45:10  13 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__deposit_line_tmp [RUN]
13:45:10  10 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__bundle_tmp [CREATE VIEW in 1.78s]
13:45:10  14 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__deposit_tmp.... [RUN]
13:45:11  11 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__customer_tmp [CREATE VIEW in 1.61s]
13:45:11  15 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__estimate_line_tmp [RUN]
13:45:11  12 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__department_tmp [CREATE VIEW in 1.38s]
13:45:11  16 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__estimate_tmp... [RUN]
13:45:11  13 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__deposit_line_tmp [CREATE VIEW in 1.20s]
13:45:11  17 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__invoice_line_bundle_tmp [RUN]
13:45:12  14 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__deposit_tmp [CREATE VIEW in 1.16s]
13:45:12  18 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__invoice_line_tmp [RUN]
13:45:12  15 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__estimate_line_tmp [CREATE VIEW in 1.16s]
13:45:12  19 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__invoice_linked_txn_tmp [RUN]
13:45:12  16 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__estimate_tmp [CREATE VIEW in 1.16s]
13:45:12  20 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__invoice_tmp.... [RUN]
13:45:12  17 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__invoice_line_bundle_tmp [CREATE VIEW in 1.20s]
13:45:12  21 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__item_tmp....... [RUN]
13:45:13  18 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__invoice_line_tmp [CREATE VIEW in 1.18s]
13:45:13  22 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__journal_entry_line_tmp [RUN]
13:45:13  19 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__invoice_linked_txn_tmp [CREATE VIEW in 1.17s]
13:45:13  23 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__journal_entry_tmp [RUN]
13:45:13  20 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__invoice_tmp [CREATE VIEW in 1.20s]
13:45:13  24 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__payment_line_tmp [RUN]
13:45:14  21 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__item_tmp.. [CREATE VIEW in 1.14s]
13:45:14  25 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__payment_tmp.... [RUN]
13:45:14  22 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__journal_entry_line_tmp [CREATE VIEW in 1.14s]
13:45:14  26 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__purchase_line_tmp [RUN]
13:45:14  23 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__journal_entry_tmp [CREATE VIEW in 1.18s]
13:45:14  27 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__purchase_tmp... [RUN]
13:45:15  24 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__payment_line_tmp [CREATE VIEW in 1.17s]
13:45:15  28 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__refund_receipt_line_tmp [RUN]
13:45:15  25 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__payment_tmp [CREATE VIEW in 1.16s]
13:45:15  29 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__refund_receipt_tmp [RUN]
13:45:15  26 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__purchase_line_tmp [CREATE VIEW in 1.17s]
13:45:15  30 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__sales_receipt_line_tmp [RUN]
13:45:16  27 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__purchase_tmp [CREATE VIEW in 1.18s]
13:45:16  31 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__sales_receipt_tmp [RUN]
13:45:16  28 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__refund_receipt_line_tmp [CREATE VIEW in 1.18s]
13:45:16  32 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__transfer_tmp... [RUN]
13:45:16  29 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__refund_receipt_tmp [CREATE VIEW in 1.18s]
13:45:16  33 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__vendor_credit_line_tmp [RUN]
13:45:16  30 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__sales_receipt_line_tmp [CREATE VIEW in 1.17s]
13:45:16  34 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__vendor_credit_tmp [RUN]
13:45:17  31 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__sales_receipt_tmp [CREATE VIEW in 1.20s]
13:45:17  35 of 76 START view model dbt_quickbooks_staging.stg_quickbooks__vendor_tmp..... [RUN]
13:45:17  32 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__transfer_tmp [CREATE VIEW in 1.40s]
13:45:17  36 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__bill_line..... [RUN]
13:45:17  33 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__vendor_credit_line_tmp [CREATE VIEW in 1.42s]
13:45:17  37 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__address....... [RUN]
13:45:18  34 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__vendor_credit_tmp [CREATE VIEW in 1.44s]
13:45:18  38 of 76 START view model dbt.my_second_dbt_model............................... [RUN]
13:45:18  35 of 76 OK created view model dbt_quickbooks_staging.stg_quickbooks__vendor_tmp [CREATE VIEW in 1.13s]
13:45:18  39 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__account....... [RUN]
13:45:19  38 of 76 OK created view model dbt.my_second_dbt_model.......................... [CREATE VIEW in 1.00s]
13:45:19  40 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__bill_linked_txn [RUN]
13:45:19  36 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__bill_line [SELECT in 2.11s]
13:45:19  41 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__bill_payment_line [RUN]
13:45:20  37 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__address.. [SELECT in 2.58s]
13:45:20  42 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__bill_payment.. [RUN]
13:45:20  39 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__account.. [SELECT in 2.39s]
13:45:20  43 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__bill.......... [RUN]
13:45:21  40 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__bill_linked_txn [SELECT in 2.07s]
13:45:21  44 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__bundle_item... [RUN]
13:45:21  41 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__bill_payment_line [SELECT in 1.87s]
13:45:21  45 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__bundle........ [RUN]
13:45:22  42 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__bill_payment [SELECT in 2.01s]
13:45:22  46 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__customer...... [RUN]
13:45:23  43 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__bill..... [SELECT in 2.26s]
13:45:23  47 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__department.... [RUN]
13:45:23  44 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__bundle_item [SELECT in 2.12s]
13:45:23  48 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__deposit_line.. [RUN]
13:45:23  45 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__bundle... [SELECT in 2.05s]
13:45:23  49 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__deposit....... [RUN]
13:45:24  46 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__customer. [SELECT in 1.77s]
13:45:24  50 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__estimate_line. [RUN]
13:45:25  47 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__department [SELECT in 1.91s]
13:45:25  51 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__estimate...... [RUN]
13:45:25  48 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__deposit_line [SELECT in 2.37s]
13:45:25  52 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__invoice_line_bundle [RUN]
13:45:26  49 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__deposit.. [SELECT in 2.39s]
13:45:26  53 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__invoice_line.. [RUN]
13:45:26  50 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__estimate_line [SELECT in 2.15s]
13:45:26  54 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__invoice_linked_txn [RUN]
13:45:26  51 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__estimate. [SELECT in 1.65s]
13:45:26  55 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__invoice....... [RUN]
13:45:27  53 of 76 ERROR creating table model dbt_quickbooks_staging.stg_quickbooks__invoice_line [ERROR in 1.13s]
13:45:27  56 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__item.......... [RUN]
13:45:27  52 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__invoice_line_bundle [SELECT in 1.47s]
13:45:27  57 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__journal_entry_line [RUN]
13:45:28  54 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__invoice_linked_txn [SELECT in 1.71s]
13:45:28  58 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__journal_entry. [RUN]
13:45:29  55 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__invoice.. [SELECT in 2.53s]
13:45:29  59 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__payment_line.. [RUN]
13:45:31  56 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__item..... [SELECT in 3.83s]
13:45:31  60 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__payment....... [RUN]
13:45:31  57 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__journal_entry_line [SELECT in 4.18s]
13:45:31  61 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__purchase_line. [RUN]
13:45:31  58 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__journal_entry [SELECT in 3.59s]
13:45:31  62 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__purchase...... [RUN]
13:45:32  59 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__payment_line [SELECT in 2.78s]
13:45:32  63 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__refund_receipt_line [RUN]
13:45:33  60 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__payment.. [SELECT in 2.30s]
13:45:33  64 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__refund_receipt [RUN]
13:45:33  63 of 76 ERROR creating table model dbt_quickbooks_staging.stg_quickbooks__refund_receipt_line [ERROR in 1.71s]
13:45:33  65 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__sales_receipt_line [RUN]
13:45:34  62 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__purchase. [SELECT in 2.71s]
13:45:34  66 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__sales_receipt. [RUN]
13:45:34  61 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__purchase_line [SELECT in 3.18s]
13:45:34  67 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__transfer...... [RUN]
13:45:35  65 of 76 ERROR creating table model dbt_quickbooks_staging.stg_quickbooks__sales_receipt_line [ERROR in 1.54s]
13:45:35  68 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__vendor_credit_line [RUN]
13:45:35  64 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__refund_receipt [SELECT in 2.21s]
13:45:35  69 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__vendor_credit. [RUN]
13:45:37  66 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__sales_receipt [SELECT in 2.85s]
13:45:37  70 of 76 START table model dbt_quickbooks_staging.stg_quickbooks__vendor........ [RUN]
13:45:37  68 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__vendor_credit_line [SELECT in 2.66s]
13:45:38  67 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__transfer. [SELECT in 3.30s]
13:45:38  69 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__vendor_credit [SELECT in 3.11s]
13:45:38  71 of 76 SKIP relation dbt_quickbooks.quickbooks__general_ledger................ [SKIP]
13:45:38  72 of 76 SKIP relation dbt_quickbooks.quickbooks__general_ledger_by_period...... [SKIP]
13:45:38  73 of 76 SKIP relation dbt_quickbooks.quickbooks__balance_sheet................. [SKIP]
13:45:38  74 of 76 SKIP relation dbt_quickbooks.quickbooks__profit_and_loss............... [SKIP]
13:45:39  70 of 76 OK created table model dbt_quickbooks_staging.stg_quickbooks__vendor... [SELECT in 1.85s]
13:45:39  75 of 76 START table model dbt_quickbooks.quickbooks__ap_ar_enhanced............ [RUN]
13:45:39  76 of 76 SKIP relation dbt_quickbooks.quickbooks__expenses_sales_enhanced....... [SKIP]
13:45:41  75 of 76 OK created table model dbt_quickbooks.quickbooks__ap_ar_enhanced....... [SELECT in 2.03s]
13:45:41  
13:45:41  Finished running 35 view models, 41 table models in 37.61s.
13:45:41  
13:45:41  Completed with 3 errors and 0 warnings:
13:45:41  
13:45:41  Database Error in model stg_quickbooks__invoice_line (models/stg_quickbooks__invoice_line.sql)
13:45:41    Invalid digit, Value 'S', Pos 0, Type: Integer 
13:45:41    DETAIL:  
13:45:41      -----------------------------------------------
13:45:41      error:  Invalid digit, Value 'S', Pos 0, Type: Integer 
13:45:41      code:      1207
13:45:41      context:   SHIPPING_ITEM_ID
13:45:41      query:     72862595
13:45:41      location:  :0
13:45:41      process:   query0_108_72862595 [pid=0]
13:45:41      -----------------------------------------------
13:45:41    compiled SQL at target/run/quickbooks_source/models/stg_quickbooks__invoice_line.sql
13:45:41  
13:45:41  Database Error in model stg_quickbooks__refund_receipt_line (models/stg_quickbooks__refund_receipt_line.sql)
13:45:41    Invalid digit, Value 'S', Pos 0, Type: Integer 
13:45:41    DETAIL:  
13:45:41      -----------------------------------------------
13:45:41      error:  Invalid digit, Value 'S', Pos 0, Type: Integer 
13:45:41      code:      1207
13:45:41      context:   SHIPPING_ITEM_ID
13:45:41      query:     72862755
13:45:41      location:  :0
13:45:41      process:   query0_72_72862755 [pid=0]
13:45:41      -----------------------------------------------
13:45:41    compiled SQL at target/run/quickbooks_source/models/stg_quickbooks__refund_receipt_line.sql
13:45:41  
13:45:41  Database Error in model stg_quickbooks__sales_receipt_line (models/stg_quickbooks__sales_receipt_line.sql)
13:45:41    Invalid digit, Value 'S', Pos 0, Type: Integer 
13:45:41    DETAIL:  
13:45:41      -----------------------------------------------
13:45:41      error:  Invalid digit, Value 'S', Pos 0, Type: Integer 
13:45:41      code:      1207
13:45:41      context:   SHIPPING_ITEM_ID
13:45:41      query:     72862802
13:45:41      location:  :0
13:45:41      process:   query0_108_72862802 [pid=0]
13:45:41      -----------------------------------------------
13:45:41    compiled SQL at target/run/quickbooks_source/models/stg_quickbooks__sales_receipt_line.sql
13:45:41  
13:45:41  Done. PASS=68 WARN=0 ERROR=3 SKIP=5 TOTAL=76

Expected behavior

the varchar field sales_item_item_id is imported as a varchar or text and the build completes successfully

dbt Project configurations

name: 'my_transformations'
version: '1.0.3'
config-version: 2

profile: 'my_transformations'

model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]

target-path: "target" # directory which will store compiled SQL files
clean-targets: # directories to be removed by dbt clean

  • "target"
  • "dbt_packages"

models:
my_transformations:
staging:
+materialized: view
shopify:
+schema: staging

vars:

quickbooks vars

quickbooks_database: dev
quickbooks_schema: fivetran_quickbooks

  • the model names, connection and project name have been changed for client confidentiality

Package versions

packages:

  • package: fivetran/quickbooks
    version: 0.4.0

What database are you using dbt with?

redshift

dbt Version

installed version: 1.0.3
latest version: 1.0.3

Up to date!

Plugins:

  • postgres: 1.0.3 - Up to date!
  • redshift: 1.0.0 - Up to date!

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

FEATURE - Add support for the `detail_type` field for Inventory Lines

Are you a Fivetran customer?

Fivetran identified feature request

Is your feature request related to a problem? Please describe.

This feature request is a result from the dbt_quickbooks#27 feature request to add the detail_type field to the where clause in the int_quickbooks__invoice_double_entry model to more accurately filter out invoice line subtotals.

Describe the solution you'd like

Add the detail_type field to the stg_quickbooks__invoice_line model.

Describe alternatives you've considered

Current solution is the alternative.

Additional context

This would not be a breaking change to users as we will add the detail_type field to our add_staging_fields macro.

FEATURE - Union Schemas Ability

Are you a Fivetran customer?

Fivetran identified request

Is your feature request related to a problem? Please describe.

A number of customers have identified that it would be beneficial to run this package for a number of quickbooks schemas. This request would be to add the same functionality within dbt_shopify_source to this quickbooks_source package. This will allow users to union multiple schemas using this package.

Describe the solution you'd like

A user of this package is able to call out a number of quickbooks schemas in their dbt_project.yml and the package is able to union them and create a union identifier so they may be used in downstream models.

Describe alternatives you've considered

Martin from Montreal Analytics highlighted the best alternative to this feature in his Medium article. It would be great however to integrate this functionality into the package.

Additional context

This should result in a breaking change as it would be a massive feature addition.

[Feature] Databricks Compatibility

Copied from fivetran/dbt_mixpanel #34.

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

For Databricks Compatibility, add the following:

  1. Buildkite testing:
    • Update pre-command (example)
    • Update pipeline.yml (example)
    • Update sample.profiles.yml (example)
    • Add the below to integration_tests/dbt_project.yml if it's not there:
dispatch:
  - macro_namespace: dbt_utils
    search_order: ['spark_utils', 'dbt_utils']
  1. For source packages, update src yml so a database won't be passed to spark (example or use below):
sources: 
  - name: <name>
    database: "{% if target.type != 'spark' %}{{ var('<name>_database', target.database) }}{% endif %}"
  1. Update any incremental models to update partition_by for databricks and add current strategies if not present:
config(
        materialized='incremental',
        unique_key='<original unique key>',
        partition_by={'field': '<original field>', 'data_type': '<original data type>'} if target.type not in ('spark','databricks') else ['<original field>'],
        incremental_strategy = 'merge' if target.type not in ('postgres', 'redshift') else 'delete+insert',
        file_format = 'delta' 
)

Describe alternatives you've considered

No response

Are you interested in contributing this feature?

  • Yes.
  • Yes, but I will need assistance and will schedule time during your office hours for guidance.
  • No.

Anything else?

No response

Invoice tax lines

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

I would like this to pull through the tables needed for invoice tax lines. I believe the required tables would be invoice_tax_line, tax_rate, and tax_agency. These are available in the base Fivetran QB connector, but are not pulled through into this flow.

In my QB, these are used to drive a tax payables line on the balance sheet. The addition of these tables is a pre-requisite to additional downstream changes to bring those calculations into the data pipeline. Without these changes the balance sheet and cash flow statement is off.

Describe alternatives you've considered

n.a.

Are you interested in contributing this feature?

  • Yes.
  • Yes, but I will need assistance and will schedule time during your office hours for guidance.
  • No.

Anything else?

No response

Cast deposit_to_account_id as integer

In the Invoice staging model, deposit_to_account_id is currently represented as a string, but since we cast account_id in the Accounts model as an integer, this FK should also be cast as an int

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.