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

Bugfix/update passthrough coulmns #38

Merged
merged 14 commits into from
May 4, 2023

Conversation

fivetran-reneeli
Copy link
Contributor

@fivetran-reneeli fivetran-reneeli commented Apr 30, 2023

PR Overview

This PR will address the following Issue/Feature:
Zendesk created ticket

This PR will result in the following new package version:

v0.9.0 - breaking change if users choose to use the alias feature to change field names

Please detail what change(s) this PR introduces and any additional information that should be known during the review of this PR:
updates the old passthrough column methodology to allow for aliasing of any field names brought in. This is useful, for example, if you wish to bring in fields across different Salesforce objects that may have the same names and wish to alias them to avoid confusion, particularly if any of the objects are joined together.

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
  • dbt run --vars '{salesforce__user_role_enabled: false}'

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
  • 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.

configs specified in internal ticket

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
  • README updates have been applied (if applicable)
  • [NA] DECISIONLOG updates have been updated (if applicable)
  • [NA] 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?

🚜

@fivetran-reneeli
Copy link
Contributor Author

  • regen docs

Copy link
Contributor

@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 for working on this! I have a few change requests to update the PR and some comments. Let me know if you have any questions

models/salesforce__opportunity_enhanced.sql Outdated Show resolved Hide resolved
models/salesforce__opportunity_enhanced.sql Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@@ -69,18 +75,22 @@ add_fields as (
case when is_closed_this_quarter then 1 else 0 end as closed_count_this_quarter

--The below script allows for pass through columns.
{{ custom_persist_pass_through_columns(pass_through_variable='salesforce__opportunity_pass_through_columns', identifier='opportunity') }}
Copy link
Contributor

Choose a reason for hiding this comment

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

We can probably use the normal version of the macro here.

models/salesforce__opportunity_enhanced.sql Outdated Show resolved Hide resolved
models/salesforce__opportunity_enhanced.sql Outdated Show resolved Hide resolved
Comment on lines +2 to +7
# - package: fivetran/salesforce_source
# version: [">=0.7.0", "<0.8.0"]

- git: https://github.com/fivetran/dbt_salesforce_source.git
revision: bugfix/update_passthrough_columns
warn-unpinned: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder to update before merge

Copy link
Contributor

@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 we are almost to the finish line. There are a few errors I ran into. Would you be able to address them and then let me know once this is ready for review.

README.md Show resolved Hide resolved

{% if var('product_2_pass_through_columns',[]) != [] %}
, product_2.{{ var('product_2_pass_through_columns') | join (", product_2.")}}
{{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__opportunity_line_item_pass_through_columns', identifier='opportunity_line_item') }}
Copy link
Contributor

Choose a reason for hiding this comment

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

When I try to pass a variable through here I get the following error.
image

This needs to refer to the identifier of the table below. Since it is being aliased we need to properly add the alias here for the identifier.

@fivetran-reneeli
Copy link
Contributor Author

fivetran-reneeli commented May 3, 2023

  • merge in package update PR

Copy link
Contributor

@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.

Thanks for marking the changes! LGTM

@fivetran-reneeli fivetran-reneeli merged commit 4d52017 into main May 4, 2023
@fivetran-reneeli fivetran-reneeli deleted the bugfix/update_passthrough_coulmns branch May 4, 2023 16:19
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.

3 participants