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

Unit tests: error - Incorrect syntax near the keyword 'WITH' #258

Closed
rgargour opened this issue Feb 12, 2025 · 5 comments
Closed

Unit tests: error - Incorrect syntax near the keyword 'WITH' #258

rgargour opened this issue Feb 12, 2025 · 5 comments

Comments

@rgargour
Copy link

I am working with Microsoft Fabric and have implemented a unit test in dbt, but I encountered an error while running it.

Image

It seems that dbt attempts to execute a query like the following:

select TOP 0 * from (
            
WITH  __dbt__cte__source_table as (
SELECT
  'toto' AS col_1,
  'titi' AS col_2
), 
src AS (
    SELECT * FROM __dbt__cte__source_table
)

SELECT
   *
FROM src 
WHERE col_1 = 'toto' -- this is my dbt model, I simplified it to be more concise
    OPTION (LABEL = 'dbt-fabric-dw');

The issue appears to be related to the WITH clause in this query.

@prdpsvs
Copy link
Collaborator

prdpsvs commented Feb 15, 2025

@rgargour , which version of adapter were you using?

@rgargour
Copy link
Author

I am using this versions of dbt-core and dbt-fabric:

Image

@prdpsvs
Copy link
Collaborator

prdpsvs commented Feb 18, 2025

I am releasing a new version of the adapter in a couple of days that should fix this issue.

prdpsvs added a commit that referenced this issue Feb 18, 2025
@tabit01
Copy link

tabit01 commented Feb 18, 2025

@prdpsvs I see this release is slated to be 1.9.1. Following the docs, this implies that the new release of the adapter will be compatible with dbt-core version 1.9.1?

prdpsvs added a commit that referenced this issue Feb 19, 2025
@prdpsvs
Copy link
Collaborator

prdpsvs commented Feb 20, 2025

The only requirement from Fabric adapter is to use "dbt-core>=1.8.0". It should work with any new version.
All my tests are on"dbt-core==1.10.0-a1"

@prdpsvs prdpsvs closed this as completed Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants