-
Notifications
You must be signed in to change notification settings - Fork 498
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
Output '*' in union_relations when no columns are found in compile mode #832
base: main
Are you sure you want to change the base?
Output '*' in union_relations when no columns are found in compile mode #832
Conversation
Happy to receive guidance on how to write a test for this if needed - not sure what the best way is because I have to hook into |
This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days. |
Although we are closing this PR as stale, it can still be reopened to continue development. Just add a comment to notify the maintainers. |
Hi I encountered the bug described in #831 too - would it be possible to get this reopened/merged? |
Thanks for reaching out @karenderer -- I'll re-open this PR and the associated issue. |
This is to handle the scenario where the upstream relations haven't been run, and you run SQLFluff against a model using union_relations, with source_column_name=None.
7819b9d
to
fcb081e
Compare
fcb081e
to
47ac8c0
Compare
@dbeatty10 @karenderer I've resolved the merge conflict, so this should be ready for review again. |
Hi, what is needed to get this merged. Currently, using the code from the patch as a workaround in BigQuery works perfectly! Using this to get my pre-commit in ci working again. |
I have the same bug happening in my CI, could we have someone take a look at this to get this merged? |
This is to handle the scenario with the
union_relations
macro where the upstream relations haven't been run, and you run SQLFluff against a model using it, withsource_column_name=None
. Currently the macro outputs nothing after the SELECT statement, resulting in parsing errors with SQLFluff.Resolves #831.
This is a:
All pull requests from community contributors should target the
main
branch (default).Description & motivation
As described in #831, I want to be able to run SQLFluff against models that use
union_relation
, where their upstream dbt models haven't been built yet, without getting a parser error. This is useful in development/CI workflows, where you want to run linting against newly created models without building them first.This is essentially the same fix as with the
star
macro.Checklist
star()
source)limit_zero()
macro in place of the literal string:limit 0
dbt.type_*
macros instead of explicit datatypes (e.g.dbt.type_timestamp()
instead ofTIMESTAMP