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

Unable to load manifest file ([Errno 2] No such file or directory: 'target/manifest.json') #31

Closed
stumelius opened this issue May 7, 2021 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@stumelius
Copy link
Contributor

stumelius commented May 7, 2021

Describe the bug
Any hook that tries to read target/manifest.json results in Unable to load manifest file ([Errno 2] No such file or directory: 'target/manifest.json') if dbt project directory (contains target/) != git project root.

To Reproduce
Steps to reproduce the behavior:

  1. Create the following project structure
my_project/
├── .git/
└── dbt_project/
     ├── dbt_project.yml
     ├── target/
     ├── models/
     └── ...
  1. Run any hook that requires the manifest

Expected behavior
I guess the current behavior is expected but there could be an option to specify the dbt project directory.

Workaround: cp -r dbt_project/target target

Version:
v1.0.0

@stumelius stumelius added the bug Something isn't working label May 7, 2021
@tomsej
Copy link
Contributor

tomsej commented May 7, 2021

Hi @smomni, thanks for bug report. For every hook that needs manifest, you have an argument --manifest, e.g.:

repos:
- repo: https://github.com/offbi/pre-commit-dbt
  rev: v1.0.0
  hooks:
  - id: check-model-columns-have-desc
    args: ["--manifest", "dbt_project/target/manifest.json"]

Does it meet your needs?

@stumelius
Copy link
Contributor Author

@tomsej Thanks for the super quick response! And yes, that solves the issue :) Is there a similar argument for the catalog as well (e.g., --catalog)?

@tomsej
Copy link
Contributor

tomsej commented May 7, 2021

Yes there should be. So your argument list will look like:

args: ["--manifest", "dbt_project/target/manifest.json", "--catalog", "dbt_project/target/catalog.json"]

@stumelius
Copy link
Contributor Author

Thanks! Works like a charm

@tomsej tomsej closed this as completed May 7, 2021
@AlessandroLollo
Copy link

args: ["--manifest", "dbt_project/target/manifest.json"]

This saved my day!
Thanks @tomsej ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants