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

SQLfluff is looking for profiles.yml for dbt cloud connection #161

Open
AWaleczek opened this issue Nov 5, 2024 · 1 comment
Open

SQLfluff is looking for profiles.yml for dbt cloud connection #161

AWaleczek opened this issue Nov 5, 2024 · 1 comment

Comments

@AWaleczek
Copy link

Hello,

I am using dbt power user in VS code with dbt cloud, Snowflake and try to get SQLfluff going.

I have the SQLfluff extension installed, and use the dbt templater as per these instructions: https://docs.sqlfluff.com/en/stable/configuration/templating/dbt.html

I tired various configurations for this part:

[sqlfluff:templater:dbt]
project_dir = <relative or absolute path to dbt_project directory>
profiles_dir = <relative or absolute path to the directory that contains the profiles.yml file>
profile = <dbt profile>
target = <dbt target>

but always end up with this error
image

To me it seems like SQLfluff is looking for a profiles.yml although I don't have one since I connect to dbt cloud.
I couldn't find a setting to tweak this behaviour.

This is how my .sqlfluff file looks otherwise:

[sqlfluff]
templater = dbt

[sqlfluff:templater:jinja]
apply_dbt_builtins = True

[sqlfluff:templater:jinja:macros]
# Macros provided as builtins for dbt projects
dbt_ref = {% macro ref(model_ref) %}{{model_ref}}{% endmacro %}
dbt_source = {% macro source(source_name, table) %}{{source_name}}_{{table}}{% endmacro %}
dbt_config = {% macro config() %}{% for k in kwargs %}{% endfor %}{% endmacro %}
dbt_var = {% macro var(variable, default='') %}item{% endmacro %}
dbt_is_incremental = {% macro is_incremental() %}True{% endmacro %}

I'm not sure where else I should look to try to fix this.

@tivoo
Copy link

tivoo commented Dec 16, 2024

Running into the same error. It seems to be that dbt has a built-in version of sqlfluff which you can run by using dbt sqlfluff format. This send the invocation to the cloud. Now that's why you don't have a profiles.yml. But for some reason I'm unable to configure the extensions to use the built-in dbt command instead of the standalone sqlfluff command. Have you found a solution to this problem yet?

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