Velir / dbt-ga4

dbt Package for modeling raw data exported by Google Analytics 4. BigQuery support, only.
MIT License
289 stars 128 forks source link

Fix to filter based on dates equal to or later than the start_date #304

Closed yamotech closed 4 months ago

yamotech commented 4 months ago

Description & motivation

In the original code cast(replace(_table_suffix, 'intraday_', '') as int64), larger values than the start_date were being retrieved, resulting in unsuccessful filtering.

select distinct
    _table_suffix
    , cast(replace(_table_suffix, 'intraday_', '') as int64) as original
    , cast(left(replace(_table_suffix, 'intraday_', ''), 8) as int64) as correct
from `{{ target.project }}`.`{{ var('combined_dataset') }}`.`events_*`
limit 1

Checklist

adamribaudo-velir commented 4 months ago

Good catch!

sippola commented 4 months ago

Happy to see this being fixed! I just discovered this issue today when investigating performance issues in dev envs that (attempt to) process limited data via the start_date variable 😄

@adamribaudo-velir is there any estimate of when a release containing this fix would go out?

adamribaudo-velir commented 4 months ago

I can do that tomorrow. You can point your packages.yml to this specific commit in the meantime if you need it sooner.