Skip to content

Suppport dbt installed through uv(x) #1799

@RobindeGrootNL

Description

@RobindeGrootNL

Describe the feature

UV is a very fast python package manager that doesn't require persisted .venv as it installs python and packages at runtime in milliseconds. This is really nice for us and we transitioned away from poetry to uv, meaning we don't have a .venv or persisted python install/directory.

The DBT power user extension seems to require a python interpreter path persisted on disk, by default in a .venv folder. Since we don't have that, we get a vscode error notification that either there is no valid Python Intepreter, or that dbt core is not installed.

The way dbt is run in our setup, is to run bin/dbt run OPTIONS, with the bin/dbt file being a bash wrapper that in the end runs eval ${DBT} "$@" with DBT := $(UVX) --python 3.12 --with "dbt-snowflake$(DBT_VSN)" --from "dbt-core$(DBT_VSN)" dbt.

Can there be an implementation in the extension to accept this as a valid dbt/python interpreter?

Describe alternatives you've considered

  • We have tried setting the Python interpreter path to the bin/dbt file itself, but that didn't prevent the error.
  • An option is of course to switch back to poetry, but we would lose all the benefits of UV we currently enjoy so that's not really an option for us.
  • We also tried to look how the dbt power user extension validates the interpreter, and made sure that e.g. asking for the dbt version works on the bin/dbt script, which does work, but it didn't prevent the error from showing up.
  • Disabling the warning/notification is an option too, but that doesn't solve the problem of the LINEAGE tab not working.
  • Install dbt also as a system dependency, just for this extension, but that means managing another dbt install that has to be kept up to date with the UV version, which opens the door for issues regarding versions and maintenance, and therefore is not a good option.

Who will benefit?

Anyone using dbt together with UV in their setup, enjoying very fast install times and no large venvs on disk that need to be tracked.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions