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
In the documentation we mention that the iterable_user_history_pass_through_columns variable will persist the columns through to the iterable__users end model.
However, when inspecting the end model it is clear that we are not persisting these passthrough columns. We should be including the persist_passthrough_columns macro in this cte in order for them to properly pass through to the end model.
I was able to use the following code in my local version of the Iterable package and confirmed the passthrough columns were persisting.
), user_with_list_metrics as (
select
user_id,
_fivetran_user_id,
unique_user_key,
email,
first_name,
last_name,
signup_date,
signup_source,
updated_at,
phone_number,
email_list_ids
--The below script allows for pass through columns.
{{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns') }}
, count(distinct list_id) as count_lists
from user_unnested
-- roll up to the user
{{ dbt_utils.group_by(n=13) }} -- WILL NEED TO MAKE DYNAMIC BASED OFF VARIABLE
We can probably achieve the dynamic group by with leveraging similar code as we did here to define the length of the variable and then just add that to the group by argument. So I imagine something like:
{% set passthrough_column_count = iterable_user_history_pass_through_columns | length %}
.... MODEL SQL HERE ....
{{ dbt_utils.group_by(n=11+passthrough_column_count ) }}
Are you willing to open a PR to help address this issue?
Yes.
Yes, but I will probably need assistance.
No.
The text was updated successfully, but these errors were encountered:
Additionally, these passthrough columns are included in other end models within this package. We should ensure the README is updated to highlight which models these passthrough fields will be present in following a successful dbt run.
Is there an existing issue for this?
Describe the issue
In the documentation we mention that the
iterable_user_history_pass_through_columns
variable will persist the columns through to theiterable__users
end model.However, when inspecting the end model it is clear that we are not persisting these passthrough columns. We should be including the persist_passthrough_columns macro in this cte in order for them to properly pass through to the end model.
dbt_iterable/models/iterable__users.sql
Lines 15 to 33 in a8032b7
Relevant error log or model output
Expected behavior
The passthrough columns persist to the end model as defined in the README.
dbt Project configurations
Package versions
Latest
What database are you using dbt with?
bigquery
dbt Version
Latest
Additional Context
I was able to use the following code in my local version of the Iterable package and confirmed the passthrough columns were persisting.
We can probably achieve the dynamic group by with leveraging similar code as we did here to define the length of the variable and then just add that to the group by argument. So I imagine something like:
Are you willing to open a PR to help address this issue?
The text was updated successfully, but these errors were encountered: