-
Notifications
You must be signed in to change notification settings - Fork 102
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
dbt doesn't properly return error message on wrong syntax #139
Comments
I think it used to return the error. At least that it was an error. Don't know when this bug was introduced. Does anyone know? There has been a lot of changes that I have not looked into really. This looks suspicious: dbt-sqlserver/dbt/adapters/sqlserver/connections.py Lines 367 to 382 in 679b351
I don't know how this is used, but reading from the code it would always return 'OK'. |
It was introduced in #126 which was part of the latest release which a @SportsTribution confirms in #135 that it happens in the |
@mikaelene that really does look sus. Older than I thought #81. I'll play w reverting that change. |
Looks like I am to blame here :-). Guess I just wanted it to work and never finished the last mile. Sorry. I'll see if I can have a look as well. |
I'll just leave this commit here because I was unsure if it was clean enough for a PR (or if it belongs on this level, or further upstream in dbt itself), but I encountered this particular problem when we homebrewed support for multiple DBs -- the root of the issue (at least with our change) was that you must process all result sets explicitly if a batch has more than one statement, otherwise you won't get error notifications for anything but the first statement. I have not verified if this is the exact same issue or if my change fixes it, but it does look awfully familiar. |
Hi folks, |
Hej @larsjohanssonblank! This is a known issue. I think it is solved in branch cursor_conundrum. Can you try that branch? @swanderz do yo know what is failing in the integration tests in that branch for azure-sql? |
I'll try later today (I'll hope), thanks @mikaelene |
@mikaelene it was just an inane error about the Azure CLI not being able to installed. It completed now, so I'm going to merge it. |
re-phrase of: #135
using
dbt-sqlserver==0.19.1
, if you make a syntax error in a model, the dbt CLI does not return the error message like it used to indbt-sqlserver<0.19.1
.This has me stumped so I'm tagging all the folks who know more about TSQL than me: @NandanHegde15 @mikaelene @semcha @panasenco
steps to reproduce
type=sqlserver
repro.sql
) with intentionally wrong sqldbt run -m repro
more info
in the full extract of the dbt log you can see this query batch get executed
Executing the above query batch directly against the database provides the following error message, that isn't returned by dbt.
Interestingly enough, looking at the db's logs, it does show the error/failure.
original motivation for change
The whole reason for this change is that if you try the below query, the error message, is
'CREATE VIEW' must be the first statement in a query batch
. This is why theCREATE VIEW
was wrapped in anEXEC
.version info
The text was updated successfully, but these errors were encountered: