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

add databricks to backtick conditional #94

Merged
merged 15 commits into from
Jul 26, 2023

Conversation

fivetran-reneeli
Copy link
Contributor

@fivetran-reneeli fivetran-reneeli commented Jul 17, 2023

PR Overview

This PR will address the following Issue/Feature:
#91
This PR will result in the following new package version: v0.9.1

Add databricks to the conditional in sfdc_formula_view_sql macro so backticks correctly compile

Please detail what change(s) this PR introduces and any additional information that should be known during the review of this PR:

  • Customer brought up the issue with a syntax error resulting from backticks not being properly placed in the code when running using their databricks warehouse. This error was missed before because the package wasn't checked to be compatible for the case where full_statement_version=false, only the default true. Therefore we added an additional run in the integration test to use full_statement_version=false. This will recreate and test the issue as well.

PR Checklist

Basic Validation

Please acknowledge that you have successfully performed the following commands locally:

  • dbt compile
  • dbt run –full-refresh
  • dbt run
  • dbt test
  • [n/a] dbt run –vars (if applicable)

Before marking this PR as "ready for review" the following have been applied:

  • The appropriate issue has been linked and tagged
  • You are assigned to the corresponding issue and this PR
  • [ n/a] BuildKite integration tests are passing

Detailed Validation

Please acknowledge that the following validation checks have been performed prior to marking this PR as "ready for review":

  • You have validated these changes and assure this PR will address the respective Issue/Feature.
  • You are reasonably confident these changes will not impact any other components of this package or any dependent packages.
  • You have provided details below around the validation steps performed to gain confidence in these changes.

This error was missed before because the package wasn't checked to be compatible for the case where full_statement_version=false, only the default true. Therefore we added an additional run in the integration test to use full_statement_version=false. This will recreate and test the issue as well.

Standard Updates

Please acknowledge that your PR contains the following standard updates:

  • Package versioning has been appropriately indexed in the following locations:
    • indexed within dbt_project.yml
    • indexed within integration_tests/dbt_project.yml
  • CHANGELOG has individual entries for each respective change in this PR
  • [ n/a] README updates have been applied (if applicable)
  • [ n/a] DECISIONLOG updates have been updated (if applicable)
  • [n/a] Appropriate yml documentation has been added (if applicable)

dbt Docs

Please acknowledge that after the above were all completed the below were applied to your branch:

  • [] docs were regenerated (unless this PR does not include any code or yml updates)

If you had to summarize this PR in an emoji, which would it be?

💃

corca and others added 2 commits June 30, 2023 13:22
…. When using Databricks, the macro should use the same replace filter as BigQuery since the backtick syntax is the same.
@fivetran-reneeli fivetran-reneeli self-assigned this Jul 17, 2023
Copy link
Collaborator

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fivetran-reneeli thanks working through this PR and incorporating the customers PR into these changes. However, I do have a few comments below that need to be applied before approving. Let me know if you have any questions.

.buildkite/scripts/run_models.sh Outdated Show resolved Hide resolved
macros/sfdc_formula_view_sql.sql Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! One last thing I noticed is that the integration tests are not actually testing the view_sql logic. Would you be able to add the following new row to the fivetran_formula model within the integration tests seed. This will ensure we are testing the view_sql (which you updated in this PR) for all tests going forward.

account_type_c,opportunity,account type,,"select main__table.id, ( CAST( account__alias.type AS STRING ) ) as account_type_c from opportunity as main__table left join account as account__alias on main__table.account_id = account__alias.id",2023-07-19 05:05:17.411 +0000

@fivetran-reneeli
Copy link
Contributor Author

This looks good to me! One last thing I noticed is that the integration tests are not actually testing the view_sql logic. Would you be able to add the following new row to the fivetran_formula model within the integration tests seed. This will ensure we are testing the view_sql (which you updated in this PR) for all tests going forward.

account_type_c,opportunity,account type,,"select main__table.id, ( CAST( account__alias.type AS STRING ) ) as account_type_c from opportunity as main__table left join account as account__alias on main__table.account_id = account__alias.id",2023-07-19 05:05:17.411 +0000

Thanks for catching that, added that row to be able to test the view_sql macro

Copy link
Collaborator

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fivetran-reneeli fivetran-reneeli merged commit c4ad9bf into main Jul 26, 2023
1 check passed
@fivetran-reneeli fivetran-reneeli deleted the bugfix/compilation_error branch July 26, 2023 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants