fivetran / dbt_salesforce_formula_utils

Package containing dbt macros to help generate salesforce formula fields synced from Fivetran.
https://fivetran.github.io/dbt_salesforce_formula_utils/
Apache License 2.0
16 stars 18 forks source link

Fix for syntax error in compiled SQL from sfdc_formula_view_sql macro... #92

Closed corca closed 1 year ago

corca commented 1 year ago

Fixes syntax issue in the compiled SQL from the sfdc_formula_view_sql macro when using Databricks.

Please provide your name and company Andrew Corcoran - West Shore Home

Link the issue/feature request which this PR is meant to address

91

Detail what changes this PR introduces and how this addresses the issue/feature request linked above. When using the package with Databricks, the sfdc_formula_view_sql macro now uses the same replace filter for `fivetran_formula` as BigQuery, since the backtick syntax returned from the source() function is the same.

Before:

select main__table.id, ( opportunity__alias.secondary_campaign_c ) as secondary_campaign_c 
from `fivetran`.`salesforce`.``service_appointment as main__table 
left join `fivetran`.`salesforce`.``opportunity as opportunity__alias on main__table.opportunity_c = opportunity__alias.id

After:

select main__table.id, ( opportunity__alias.secondary_campaign_c ) as secondary_campaign_c 
from `fivetran`.`salesforce`.service_appointment as main__table 
left join `fivetran`.`salesforce`.opportunity as opportunity__alias on main__table.opportunity_c = opportunity__alias.id

How did you validate the changes introduced within this PR? Local testing with dbt compile, Databricks warehouse testing with dbt run

Which warehouse did you use to develop these changes? Databricks

Did you update the CHANGELOG?

Did you update the dbt_project.yml files with the version upgrade (please leverage standard semantic versioning)? (In both your main project and integration_tests)

Provide an emoji that best describes your current mood 🔨

fivetran-reneeli commented 1 year ago

Hi @corca! Thank you for opening and contributing this PR! We've merged this into our current PR that we are working off of. Expect this to be released within the next week!