Closed teddy-ruby closed 1 year ago
Hi @teddy-ruby thanks so much for raising this issue!
It looks like the issue you are highlighting is due to a translation issue (with the coalesce divide by zero you mentioned). Unfortunately, the dbt package does not control the translations which occur, but rather materializes the translation synced within the Salesforce connector in the fivetran_formula
or fivetran_formula_model
tables in your warehouse.
Fortunately, our customer support and engineering teams are able to help address the issue you have highlighted. I would recommend opening a Support Ticket to raise this with our CS and Eng teams so they may work with you on a fix within the connector.
Marking this as wontfix
as this is not something we will be able to address within the dbt package. @teddy-ruby feel free to ask me any other questions. Otherwise, once your support ticket is opened we should be able to close this issue and keep the conversation moving forward in the support ticket.
Closing this issue as the path forward is to open a Support Ticket (linked in my previous response).
Please feel free to reopen if you feel there is more to discuss.
Is there an existing issue for this?
Describe the issue
Thanks so much for this package! When trying to generate salesforce formula fields I get a Divide by zero error. I am using a view materialization in production so I wasn't catching this on the model run but just discovered this when querying the view. I then changed the materialization to table locally and can reproduce the error on model run.
Generally, I believe the issue is that COALESCE is being used with a fallback value of 0 which is then being used in the denominator. I highlighted the problematic line below.
Thanks!
Relevant error log or model output
Expected behavior
I would hope for a safe divide by 0 behavior and the value of the formula field to be null. This would allow the model to still be used.
dbt Project configurations
name: 'fivetran_salesforce' version: '1.0.0' config-version: 2
profile: 'fivetran_salesforce'
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
Package versions
packages:
What database are you using dbt with?
redshift
dbt Version
Core:
Plugins:
Additional Context
No response
Are you willing to open a PR to help address this issue?