-
Notifications
You must be signed in to change notification settings - Fork 16
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
[Bug] column_list_to_dict macro will override the column's metadata if you pass through a column that is already selected from the source. #50
Comments
Hi @tunguyensinh thanks for opening this issue! It is an interesting one. I think your first suggestion
might be the best path since I saw you checked you were willing to open a PR. If that's still the case, for now you can create a fork of this repo, make your changes, and then open a PR against this repo with your changes. We'll let you know what else we need from there, or let us know if you have any other questions! |
Hi @tunguyensinh friendly bump--just let us know if you have any questions on opening the PR! |
Hi @tunguyensinh I worked on this myself a little, and I believe I have a working test branch. You can install it in place of the salesforce package in your packages.yml: - git: https://github.com/fivetran/dbt_salesforce_source.git
revision: test/passthrough-bug
warn-unpinned: false I used the below var for the way I set up the changes. I ended up working around the renaming. vars:
salesforce__lead_pass_through_columns: # pass columns from lead source
- name: "Email"
alias: "internal_email"
transform_sql: "case when email like '%domain%' then true else false end" If you're able to try it out, let me know how this works for you! |
Hi @tunguyensinh just checking in if you had a chance to take a look at this! |
Hi @tunguyensinh, While validating my test branch, I realized the issue was related to the formatting of the passthrough variable. The formatting below is what resolved the issue for my test branch, rather than any changes I made. Here’s the formatting that worked: vars:
salesforce__lead_pass_through_columns: # pass columns from lead source
- name: "Email"
alias: "internal_email"
transform_sql: "case when email like '%domain%' then true else false end" I’ll also make some updates to the documentation to clarify this behavior. I’ll mark this issue as |
Is there an existing issue for this?
Describe the issue
For example, if we configure pass-through column email with a different alias
This line call
column_list_to_dict
macro, that will override the existing email's metadata, therefore, causerenamed_column_name
field empty, result in invalid SQL syntax (rendered bysalesforce_source.coalesce_rename
macro):Relevant error log or model output
Expected behavior
Should not override metadata of existing column,
expected:
Possible solution
Add the field
{is_rename: True}
for pass-through columns inget_*_columns.sql
or within thefivetran_utils.add_pass_through_columns
macro so that the macrocolumn_list_to_dict
does not override them. Keen to hear your suggestions.dbt Project configurations
Package versions
">=1.1.0", "<1.2.0"
What database are you using dbt with?
redshift
How are you running this dbt package?
dbt Core™
dbt Version
1.8
Additional Context
No response
Are you willing to open a PR to help address this issue?
The text was updated successfully, but these errors were encountered: