Skip to content

do not null out fields that dbt cannot calculate #56

@jeff-skoldberg

Description

@jeff-skoldberg

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

In some cases fivetran_formulas table has a null value in the SQL field, so dbt is not able to rebuild the formula. Therefore, to get ALL formula fields from salesforce, we need a mixed approach: Let dbt calculate fields that it can, then get the remaining fields from fivetran (with the risk that those formulas can go stale).

Simply put, the behavior should be: if fivetran_formulas.SQL is null, the dbt macro skip that field. Currently it will present null instead of the values that Fivetran brought in.

We stated this approach brings on risk of stale formulas. There should be a dbt test that checks the formula history table for updates to fields that dbt cannot re-calculate. The test should fail if any fivetran sync time for the data is less than the most recent formula update time. This way we can alert users of stale formulas via email and the user can run a full re-sync in fivetran.

Describe alternatives you've considered

Joe suggested to I can create a macro that dynamically builds the sfdc_exclude_formulas variable. The problem with this approach is that field will be excluded from the final output all together. Let's use an example to clarify this confusing statement.

Fivetran is syncing Salesforce table CONTACT and Fivetran Customer Support has enabled the formula fields to sync. Then I have a field called region_c, which fivetran is syncing but dbt cannot re-calculate. If I exclude region_c in sfdc_exclude_formulas, the resulting dbt view would not have the region_c column at all. So now if I want a view that has region_c from fivetran and all other fields from the macro, I need to do something like this:
select a.*, b.region_c from {{ref(fivetran_dbt_macro_contact_table)}} a join {{ref(original_salesforce_contact_table)}} b on a.id = b.id .

Hopefully that is clear why I do not have a work around that I can move forward with.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:p4Affects few users; pick up when availablestatus:staleIssue was blocked or had no user response for more than 30 days

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions