dbt-msft / tsql-utils

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

get_date_dimension not working #74

Closed hammadhasandogar closed 2 years ago

hammadhasandogar commented 2 years ago

Seems like compiled query generates nested CET expression, which causes the failure.

{{ dbt_date.get_date_dimension('2000-01-01', '2050-12-31') }} Incorrect syntax near 'with'.

with base_dates as (    
with date_spine as (...

package.yml

packages:
  - package: calogica/dbt_date
    version: 0.4.1
  - package: dbt-labs/dbt_utils
    version: 0.7.4
  - package: dbt-msft/tsql_utils
    version: 0.8.1

dispatch defined in dbt_project.yml

dispatch:
  - macro_namespace: dbt_utils
    search_order: ['tsql_utils', 'dbt_utils']
  - macro_namespace: dbt_date
    search_order: ['tsql_utils', 'dbt_date']
hammadhasandogar commented 2 years ago

it was supported at once point, but the code base has evolved significantly since to include many nested CTEs, which aren't suported today in TSQL. Click here to upvote and get the feature supported!

dataders commented 2 years ago

thanks @hammadhasandogar! I moved this to this repo, so it can be of more help in the future! If you'd like it'd be very helpful if you could make a quick pull request here that changes tells users that get_date_dimension isn't supported for TSQL adapters.

image