You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
15:45:04 Database Error in model stg_stripe__invoice (models/stg_stripe__invoice.sql)
15:45:04 column name "currency" is duplicated
15:45:04 compiled Code at target/run/stripe_source/models/stg_stripe__invoice.sql
08:43:00 Database Error in model stripe__invoice_details (models/stripe__invoice_details.sql)
08:43:00 syntax error at or near "{"
08:43:00 compiled Code at target/run/stripe/models/stripe__invoice_details.sql
08:43:00
I guess that I'm not utilizing the alias feature in the code:
{% if var('stripe__invoice_metadata',[]) %}
{% for metadata in var('stripe__invoice_metadata') %}
,invoice.{{ metadata }} as invoice_{{ metadata }}
{% endfor %}
{% endif %}
Would love for some guidelines
Relevant error log or model output
No response
Expected behavior
currency from the metadata appears in the final invoice table.
hey there 👋 -- so just to clarify, the below code is something you've added manually to a forked version of the stripe__invoice_details model?
{% if var('stripe__invoice_metadata',[]) %}
{% for metadata in var('stripe__invoice_metadata') %}
,invoice.{{ metadata }} as invoice_{{ metadata }}
{% endfor %}
{% endif %}
if i'm understanding that correctly, i believe you would need to adjust the above to treat stripe__invoice_metadata as a dictionary instead of a list. so something like
{% if var('stripe__invoice_metadata',[]) %}
{% for metadata in var('stripe__invoice_metadata') %}
,invoice.{{ metadata.alias if metadata.alias else metadata.name }} as invoice_{{ metadata.alias if metadata.alias else metadata.name }}
{% endfor %}
{% endif %}
16:03:15 Database Error in model stripe__invoice_line_item_details (models/stripe__invoice_line_item_details.sql)
16:03:15 syntax error at or near "{"
16:03:15 compiled Code at target/run/stripe/models/stripe__invoice_line_item_details.sql
fivetran-joemarkiewicz
changed the title
[Bug] Custom metadata column don't use alias feature
[Question] Custom metadata column don't use alias feature
Jan 17, 2024
Is there an existing issue for this?
Describe the issue
Following #65 I am trying to add a column from the metadata which already exists in the table.
we have
currency
in the metadata that we want to extract.Adding it to the var:
Results an issue:
So I was trying to add the alias like in the doc:
and it fails with:
I guess that I'm not utilizing the alias feature in the code:
Would love for some guidelines
Relevant error log or model output
No response
Expected behavior
currency
from the metadata appears in the final invoice table.dbt Project configurations
As described in #65
Package versions
As described in #65
What database are you using dbt with?
redshift
dbt Version
As described in #65
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: