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

[BUG] Failed to generate overview if target-path is configured using Jinja template #376

Open
kokorin opened this issue Nov 23, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@kokorin
Copy link

kokorin commented Nov 23, 2022

Describe the bug

Overview generation fails with

FileNotFoundError: [Errno 2] No such file or directory: "C:\path\to\jaffle_shop\{{ env_var('artifact_dir', '.') }}\target\manifest.json"

when dbt_project.yml uses Jinja in target-path

...
target-path: "{{ env_var('artifact_dir', '.') }}/target"
...

Expected behavior
Overview is generated.

To Reproduce
Steps to reproduce the behavior:

  1. Clone Jaffle Shop
  2. Set target-path to "{{ env_var('artifact_dir', '.') }}/target"
  3. Run re_data overview generate

Logs and additional context
re_data/command_line.py:

def get_target_paths(kwargs, re_data_target_dir=None):
    project_root = get_project_root(kwargs)
    partial = Project.partial_load(project_root)
    dbt_target_path = os.path.abspath(partial.project_dict['target-path'])

    if re_data_target_dir:
        re_data_target_path = os.path.abspath(re_data_target_dir)
    else:
        re_data_target_path = os.path.join(dbt_target_path, 're_data')

    return dbt_target_path, re_data_target_path

re_data reads not-yet-rendered DBT project with Project.partial_load(project_root).
So the solution is to render project before getting target path.

@kokorin kokorin added the bug Something isn't working label Nov 23, 2022
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

1 participant