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
SQLFluff fails when dbt model is disabled #931
Comments
@dwallace0723 - I'm pretty sure in this case, a disabled model isn't compiled. The I'm tempted to say that the solution here is a clearer error message which says the user will either need to enable the model, or use a different templater. Using the basic More advanced solutions would involve:
@dmateusp , as the expert on the dbt templater, what do you think? |
@alanmcruickshank what are your thoughts on just skipping disabled dbt models and displaying a message saying the file/model was skipped or couldnt be found? dbt does something similar when trying to run disabled models:
|
With the PR I opened, here's the new behavior:
|
* Add an exception to skip files⚠️ * Skip files on linting when they raise skip file exception 🔨 * Raise skip file exception in dbt templater when model is disabled * Test all! ✨ * Add to CHANGELOG 🧐
Can we silence the warning as well? |
if a dbt model is disabled (i.e. has configuration of
enabled = false
) sqlfluff will fail with the following internal error:This error seems a little misleading. Additionally, I'm curious about the design decision to not lint dbt models that are disabled.
Expected Behaviour
For sqlfluff to be able to lint disabled models. Or at least have a more helpful error message.
Steps to Reproduce
Disable a dbt model and try to lint it.
Version
Configuration
The text was updated successfully, but these errors were encountered: