AltimateAI / AltimateAI/vscode-dbt-power-user
Incorrect Compile Code from DBT Power User
- Lingua principale
- JavaScript
- Stelle
- 585
- Fork
- 121
- Merge medio
- 5g 39m
- PR unite (30g)
- 4
Descrizione
### Expected behavior
While using the Complied DBT preview feature result is not as expected:
1. In my model, I'm using a macro for the incremental logic, which contains various if-else statements to determine the compiled code. However, it seems that part of the logic is being skipped, and I'm not sure why this is happening.



2. I compared the compiled code generated by DBT with the code generated by the plugin, and I noticed that several pieces of logic that should be present in the compiled code are missing.

3. In my model, after implementing the incremental logic, I use another macro to apply the casting logic to ensure each column is cast to its appropriate type. However, this step is failing.

4. While executing the query, it's failing with the following error. My DBT architecture places all models under a folder called CDW. However, using dbt deps, we're downloading the project dependencies into a core folder, as specified in the packages.yml file.
{
"code": -1,
"message": "Database Error\n Syntax error: SELECT list must not be empty at [305:1]",
"data": "\"Error: Database Error\\n Syntax error: SELECT list must not be empty at [305:1]\\n\\tat DBTCoreProjectIntegration_1. (c:\\\\Users\\\\.vscode\\\\extensions\\\\innoverio.vscode-dbt-power-user-0.39.12\\\\dist\\\\extension.js:18398:127)\\n\\tat Generator.throw ()\\n\\tat rejected (c:\\\\Users\\\\.vscode\\\\extensions\\\\innoverio.vscode-dbt-power-user-0.39.12\\\\dist\\\\extension.js:25808:28)\""
}


### Actual behavior
After compiling the code
1. It should read the macro logic and based on that it should return the correct code.
2. Should apply the casting logic as mentioned the model using the specific Macro.
3. Query Result should return the value
### Steps To Reproduce
Using **poetry shell** to activate the poetry virtual env
Using python version 3.11.6
dbt-core 1.6.1
dbt-bigquery 1.6.4
Create any model having Macro for incremental logic using if-else where it'll check if the table exist then if condition else another condition


### Log output/Screenshots
_No response_
### Operating System
Windows 10
### dbt version
1.6.1
### dbt Adapter
dbt-bigquery 1.6.4
### dbt Power User version
v0.39.12
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.