Skip to content
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

Not specifying a SQL Dialect in extension settings leads to confusing error #122

Open
dsmith7789 opened this issue Jan 22, 2024 · 1 comment

Comments

@dsmith7789
Copy link

The traceback error given when using the sqlfluff extension is not readily understandable if you don't specify a dialect.
image

image

Error text ([username] is a placeholder):
Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in run_code File "C:\Users[username]\AppData\Local\Programs\Python\Python312\Scripts\sqlfluff.exe_main.py", line 7, in File "C:\Users[username]\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1157, in call return self.main(*args, **kwargs) ^^^^^^^^^^^ ^^^^^^^^^^^^^^^ File "C:\Users[username]\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "C:\Users[username]\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users[username]\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1434...

After specifying a dialect (ex. ANSI), the error goes away and the extension works as expected.

image
image

Result:
image

@thijs-nijhuis
Copy link

Hi, just installed this beautiful extension (I worked with it in my previous assignment) and I am getting this exact same error message. Unfortunately, setting the dialect doesn't solve it for me. I set it to both 'databricks' and 'ansi'. Apart from this, I have only set the sqlfluff.executablePath since I have sqlfluff installed in a virtual environment.
@dsmith7789, do you have any other settings in there that I might need to set as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants