-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[CT-1946] [Bug] dbt snapshot fails if the last line is a comment #6781
Comments
Thank you for reporting this (and opening a PR!) @RobbertDM This is similar to this one for incremental models: How we should test for this (and similar issues):
|
Extremely naive question -- why would these models end in comments? What's a use case? I just find it strange that adding whitespace is apparently a fix here. Not used to seeing that |
It's a fair question — but also something we should support. Comments, wherever they are, should work.
During BLG:
|
|
Makes total sense. I knew I was just lacking imagination and I appreciate you filling me in! edit: just circle back to say well of course comment should work everywhere. I regret ever being questioning here |
Is this a new bug in dbt-core?
Current Behavior
When making a snapshot and using the
check
strategy with specified columns (notall
), if the last line of your snapshot is a comment, it yields14:50:11 TrinoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 12:16: mismatched input '<EOF>'. Expecting: ')'", query_id=20230130_145011_02592_b7axv)
because the produced query is:
Check out the
-- some comment ) subq
line.Expected Behavior
When making a snapshot and using the
check
strategy with specified columns (notall
), if the last line of your snapshot is a comment, it yieldsa working snapshot
because the produced query is:
Check out the
) subq
line.Steps To Reproduce
check
strategycheck_cols=['col1','col2']
, notall
--
commentRelevant log output
No response
Environment
Which database adapter are you using with dbt?
other (mention it in "Additional Context")
Additional Context
adapter used: dbt-trino
The text was updated successfully, but these errors were encountered: