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

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

Conversation

yamotech
Copy link
Contributor

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
  • original: {{ YYYYMMDD }}{{ property_id }}
  • correct: {{ YYYYMMDD }}

Checklist

  • I have verified that these changes work locally
  • [na] I have updated the README.md (if applicable)
  • [na] I have added tests & descriptions to my models (and macros if applicable)
  • I have run dbt test and python -m pytest . to validate existing tests

@adamribaudo-velir
Copy link
Collaborator

Good catch!

@adamribaudo-velir adamribaudo-velir merged commit 6c5b989 into Velir:main Feb 27, 2024
1 check passed
@sippola
Copy link

sippola commented Feb 28, 2024

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
Copy link
Collaborator

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

@yamotech yamotech deleted the fix-to-filter-based-on-dates-equal-to-or-later-than-the-start_date branch March 24, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants