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

BUG - [your bug title here] #19

Closed
2 of 9 tasks
jeffspringer opened this issue May 17, 2021 · 4 comments
Closed
2 of 9 tasks

BUG - [your bug title here] #19

jeffspringer opened this issue May 17, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@jeffspringer
Copy link

Are you a current Fivetran customer?
Fivetran partner - Jeff Springer, Principal Consultant - DAS42

Describe the bug
Currency fields (usually 'amount' fields) are being cast to 'decimal' without precision. In Snowflake, this means the values are defaulted to 'number(38,0)' so all the values are losing the cents.

Steps to reproduce

  1. Running this query will always result in values without cents:
select
    account_number
    , account_name
    , sum(amount)
from
    <database>.<schema>."QUICKBOOKS__PROFIT_AND_LOSS"
group by 1,2
order by 1

Expected behavior
Expect values to include cents - i.e. cast to number(38, 2).

Project variables configuration

# Name your project! Project names should contain only lowercase characters
# and underscores. A good package name should reflect your organization's
# name or the intended use of these models
name: 'appleseed_quickbooks'
version: '1.0.0'
config-version: 2

# This setting configures which "profile" dbt uses for this project.
profile: 'appleseed_snowflake'

# These configurations specify where dbt should look for different types of files.
# The `source-paths` config, for example, states that models in this project can be
# found in the "models/" directory. You probably won't need to change these!
source-paths: ["models"]
analysis-paths: ["analysis"]
test-paths: ["tests"]
data-paths: ["data"]
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_modules"


# Configuring models
# Full documentation: https://docs.getdbt.com/docs/configuring-models

# In this example config, we tell dbt to build all models in the example/ directory
# as tables. These settings can be overridden in the individual model files
# using the `{{ config(...) }}` macro.
models:
  appleseed_quickbooks:
      # Applies to all files under models/example/
      example:
          materialized: view

vars:
    quickbooks_database: internal_db
    quickbooks_schema: appleseedquickbooks
    using_credit_memo: false
    using_department: false
    using_estimate: false
    using_invoice: false
    using_invoice_bundle: false
    using_payment: false
    using_refund_receipt: false
    using_sales_receipt: false
    using_vendor_credit: false

Package Version

  - package: fivetran/quickbooks
    version: 0.2.1

Warehouse

  • BigQuery
  • Redshift
  • Snowflake
  • Postgres
  • Databricks
  • Other (provide details below)

Additional context
None

Screenshots
None

Please indicate the level of urgency
Seems fairly high. Unless I'm missing something, I would expect others would have seen this behavior some time ago.

Are you interested in contributing to this package?

  • Yes, I can do this and open a PR for your review.
  • Possibly, but I'm not quite sure how to do this. I'd be happy to do a live coding session with someone to get this fixed.
  • No, I'd prefer if someone else fixed this. I don't have the time and/or don't know what the root cause of the problem is.
@jeffspringer jeffspringer added the bug Something isn't working label May 17, 2021
@fivetran-joemarkiewicz
Copy link
Contributor

Thanks for opening this issue @jeffspringer! I have been assigned to implement this bug fix into the package during this sprint. However, I will be out of office until 6/1.

I recall you had mentioned earlier in the week that you had implemented a fix for this on your own project. If that is the case, and you are open to contributing to the package then I would welcome you to create a PR with the updates! Otherwise, I will implement the fixes for this bug when I return.

Thank you!

@fivetran-joemarkiewicz
Copy link
Contributor

@jeffspringer I was able to apply the fix for this Issue and merge it into the master branch. We will refrain from cutting a new release until the Issue #18 is also resolved so we may bundle all updates in one release.

I will post back here once we cut the new release.

@jeffspringer
Copy link
Author

jeffspringer commented Jun 2, 2021 via email

@fivetran-joemarkiewicz
Copy link
Contributor

FYI the new release v0.2.3 has been cut and should be live on the dbt hub tomorrow morning!

Closing this ticket as this update has been included in the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants