vscode-sqlfluff icon indicating copy to clipboard operation
vscode-sqlfluff copied to clipboard

[Templater: dbt] User Error: The dbt templater does not support stdin input, provide a path instead

Open moseleyi opened this issue 1 year ago • 4 comments

image

I'm getting this error every time I open a sql file in dbt project. Not sure what to do?

moseleyi avatar Aug 19 '24 10:08 moseleyi

Same issue, output from SQLFluff is:

------------------------------------------------------------

Format triggered for /etl/dbt/ssmp/models/looker_explores/explore_product_availability_score.sql

------------------------------------------------------------

Reading from stdin, not file, input may be dirty/partial

--------------------Executing Command--------------------

/etl/dbt/ssmp/.venv/bin/sqlfluff fix --stdin-filename dbt/ssmp/models/looker_explores/explore_product_availability_score.sql -

------------------------------------------------------------

Received close event, code 2 signal null
Raw stdout output:

------------------------------------------------------------



------------------------------------------------------------

Raw stderr output:

------------------------------------------------------------


User Error: The dbt templater does not support stdin input, provide a path instead


------------------------------------------------------------

JunkMyFunk avatar Aug 28 '24 12:08 JunkMyFunk

Do you have the extension configured for DBT?

  "sqlfluff.linter.run": "onSave",
  "sqlfluff.experimental.format.executeInTerminal": true,
  "editor.formatOnSave": false,

RobertOstermann avatar Aug 28 '24 13:08 RobertOstermann

Surprisingly now no file is detected properly: image It's weird since obviously it's a file I opened and its path is correct: image

moseleyi avatar Aug 29 '24 07:08 moseleyi

I was missing "sqlfluff.experimental.format.executeInTerminal": true, adding this resolved the issue.

JunkMyFunk avatar Aug 29 '24 08:08 JunkMyFunk