-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Issues with SQLFluff Command Execution and Path Specification #116
Comments
|
Thanks for the quick reply, but I still can't get the plugin to work. Same error as alwas: missing env vars. I don't understand why a linter needs env vars to lint. I thought this was fixed in v2.1.1: https://stackoverflow.com/questions/76330626/missing-env-variable-specified-in-profiles-yaml-running-sqlfluff-on-pre-commit What do you recommend I change specifically in my user preferences or sqlfluff.config? |
Do you get that same error when running sqlfluff from the command line? If so, you should create an issue in the main sqlfluff repo. I only handle issues with the extension itself and am not an expert on sqlfluff. |
No, the generated sqlfluff command runs fine when running from the terminal. The plugin starts executing the generated command and exits immediately with the traceback I provided above. |
Ok, I have not seen this issue before and am not sure how to solve it. If you check the output channel it should tell you the exact command being run by the extension. The extension should be running in the terminal and use those env vars as well, but you might have to manually set whatever you need in the settings.json. You could check to see what env vars you have set on the command line when it is working and copy the relevant ones over. |
Thank you for your help. This settings.json fixed my problem, but I still find it weird that these env variables have to be specified. |
Update When I run sqlfluff manually using the command line, it successfully identifies the environment variables defined in my [sqlfluff:templater:dbt]
project_dir = ./dbt
profiles_dir = ./dbt
profile = dbt_snowflake
target = prod However, when I attempt to achieve the same via the extension, it either fails to find the reference to these environment variables or possibly does not look for them at all.
|
I will probably not be updating the extension to handle environment variables in the |
Environment:
/workspace/project/dbt/env/bin/sqlfluff
)User Preferences (JSON):
Issue Description:
When I attempt to format a document using the "Format Document" right-click option, I receive an error related to missing environment variables (SNOWFLAKE_ACCOUNT). The exact command executed and output received is as follows:
Executed Command:
Output:
Strangely, when I manually change my working directory to
/workspace/project/
and run the exact same command in the terminal, the file is linted and fixed successfully.Questions:
/workspace/project/dbt
. What adjustments are needed to achieve this?Any guidance or suggestions would be greatly appreciated.
The text was updated successfully, but these errors were encountered: