dbt-msft / tsql-utils

dbt-utils for the dbt-msft family of packages
MIT License
25 stars 25 forks source link

Fix the macro when the datepart = hour #34

Closed b-per closed 3 years ago

b-per commented 3 years ago

With a datepart smaller than day, the datediff in the top was comparing datetime to date (i.e. datetime at the first minute of the day), not selecting enough records for populating the last day.

This update selects enough values in thetop by looking at the next day. Additional values are still filtered out below in the macro, in the "filtered" CTE.

b-per commented 3 years ago

Closing this one. I just read from dbt-utils that the end-date needs to be excluded. I will check the behaviour of date_spine with a datepart of hour in bigquery and compare with the results of this package.