Dbt-utils/date_spine not working

Hi everyone!

I am a newbie in the dbt community and learning on dbt Learn on demand.

Even though it seems quite straightforward, I have been through many frustrations because I apply exercises on BigQuery with dbt CLI.

Right now, I am at Packages/Packages with macros stage and even though I just thoroughly follow the instructions; the extension is not working for the date_spine function and here follows the error (with the copy/pasted values in the official documentation of date_spine):

Runtime Error
  Database Error in model all_dates (models/marts/core/all_dates.sql)
      Function not found: dateadd; Did you mean date_add? at [8:14]

Therefore, I went on the extension’s git repo and had a look if any issue related to BigQuery; there is indeed one issue but it has been closed since and I cannot find any real solution in that issue thread.

Has anybody an idea what I can do to use that function?

Thanks a lot in advance!

Hi Ronald, happy to try and help sort out what you’re running into here!

On very quick inspection, this part of your error message: Function not found: dateadd; Did you mean date_add? leads me to believe that it might have something to do with either (a) flagging the incorrect warehouse in your dbt project, or (b) potentially using a bugged earlier version of the utils package.

A couple things you could check here that might help debugging:

  1. Confirm that you’re on the latest released version of dbt, and you’re using the latest version of dbt-helper
  2. Check to see that BigQuery is defined as the warehouse in your project’s target which could be found in your profiles.yml file which you should have saved locally in your .dbt/ folder

If these two don’t help, feel free to reply here and let me know what version your on so I can try replicating and attempt to help debug this issue for you!

1 Like

Hi Andrew,
I have the same issue. Currently, we use - package: fishtown-analytics/dbt_utils
version: 0.6.4 and BigQuery is the warehouse.

Any hint would be helpful.