【问题标题】:How to set location of profiles.yml and dbt_project.yml files in DBT?如何在 DBT 中设置profiles.yml 和dbt_project.yml 文件的位置?
【发布时间】:2022-10-20 20:58:02
【问题描述】:

运行 dbt debug --config-dir 显示位置不正确。

例如。)

12:35:52  Running with dbt=1.0.3
12:35:52  To view your profiles.yml file, run:

open /The/wrong/directory

我如何告诉 DBT 我已经移动了 profiles.ymldbt_profile.yml 文件?

【问题讨论】:

    标签: sql database etl dbt


    【解决方案1】:

    dbt run --help 表明有两个标志用于此特定目的。

      --project-dir PROJECT_DIR
                            Which directory to look in for the dbt_project.yml file. Default is the current working directory and its parents.
      --profiles-dir SUB_PROFILES_DIR
                            Which directory to look in for the profiles.yml file. Default = /Users/username/.dbt
    

    您要运行的命令是:

    dbt run --project-dir /path/to/new/dbt_project.yml_file --profiles-dir /path/to/new/profiles.yml_file
    

    【讨论】:

    • --profiles-dir /path/to/new/profiles.yml_file 不起作用。您必须为 --profiles-dir 指定一个文件夹,并且在该文件夹中,您的配置文件必须命名为 profiles.yml
    • 很好发现@zoltanctoth。当文件路径读取--profiles-dir /path/to/new/dbt_project.yml_file 时,我的回答中暗示了这一点。意思是位置必须包含profiles.yml 文件。所以,感谢您提出这个重要的澄清点:)
    【解决方案2】:

    在您的提示中输入:export DBT_PROFILES_DIR=/path/to/folder

    此命令会将您的profiles.yml 的位置重新分配给/path/to/folder 中提到的文件夹。

    完成后,运行:dbt debug --config-dir

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-23
      • 2017-04-22
      • 2017-11-09
      • 2022-10-18
      • 2023-02-17
      • 2022-11-30
      相关资源
      最近更新 更多