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

Allow specifying of "project-dir" #67

Open
ybressler opened this issue Jun 28, 2024 · 4 comments
Open

Allow specifying of "project-dir" #67

ybressler opened this issue Jun 28, 2024 · 4 comments

Comments

@ybressler
Copy link

ybressler commented Jun 28, 2024

Want:

--project-dir cli argument.

Explanation:

Similar to dbt run --project-dir my-project/, I want to be able to parse and lint my project in a single command.

My current workaround is to run dbt parse ... then point to the manifest. But I'd rather have a single command.

@matthieucan
Copy link
Contributor

Thanks for reporting and sharing your use-case!
Out of curiosity, does dbt-score run in the same virtual environment as dbt? (alternatively, does dbt run in a virtual environment, or is it installed system-wide?)

dbt-score makes use of the environment variable DBT_PROJECT_DIR to look for the dbt project. However I'm afraid it only works if that variable is a relative path appended to the current working directory, but making it work with absolute paths should be very easy
Ref: https://github.com/PicnicSupermarket/dbt-score/blob/master/src/dbt_score/dbt_utils.py#L59-L66

@jochemvandooren
Copy link
Contributor

Also, just to check:

Have you tried running dbt-score lint --run-dbt-parse? It will actually try to run dbt parse, you will have to make sure your environment is setup correctly so it can find the dbt project though!

@ybressler
Copy link
Author

  • dbt-score indeed executes in the same virtual environment as dbt. (Using poetry as version manager)
  • Relatedly, I don't rely on the DBT_PROJECT_DIR env var, instead, pass it to the command line on each execution. This has a bit to do with project layout
  • dbt-score lint --run-dbt-parse fails, it cannot find the project yml file

@matthieucan
Copy link
Contributor

Understood, thanks for the additional info. I think this feature definitely makes sense. Would you like to contribute it?

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

No branches or pull requests

3 participants