Recently, upgraded my dbt to v1.3 and facing some issues with a few macros but a new compilation error keeps coming for datediff or datespine , which is not working out
Error message:
09:29:41 'dict object' has no attribute 'datediff'. This can happen when calling a macro that does not exist. Check for typos and/or install package dependencies with "dbt deps".
I’m trying to fix this so that my sessionization code works out Source: segment/segment_web_page_views__sessionized.sql at main · dbt-labs/segment · GitHub
My packages look like this : packages:
- package: dbt-labs/dbt_utils version: “1.0.0”
What I’ve already tried
Tested a few new macros like datespine, but the same error shows up. Also the macro does exist in dbt-utils too - so not sure what’s causing it. https://github.com/dbt-labs/dbt-utils/blob/main/macros/sql/date_spine.sql
Upgraded to dbt v1.4, but same error persists
Code part that causes errors: -
diffed AS (
--calculates `period_of_inactivity`.
SELECT
*,
{{ dbt_utils.datediff(
'previous_tstamp',
'timestamp',
'second'
) }} AS period_of_inactivity
FROM
lagged
Would appreciate any directional help here.