有没有办法覆盖 dbt Cloud CI 运行的架构名称?

Is there a way to override the schema names for dbt Cloud CI runs?

我们使用 dbt 云来 运行 我们的 dbt 项目。在 CI 运行 秒,dbt Cloud 使用与 PR 编号相关的架构名称,例如dbt_cloud_pr_5205_543.

有没有办法覆盖此行为?

更新:我们已经更新了我们的宏,如下所示。

generate_schema_name.sql 
% macro generate_schema_name(custom_schema_name, node) -%}      
    {%- set default_schema = target.schema -%}      
    {%- if target.name[-3:] == 'dev' -%}          
        {{ target.schema }}_{{ custom_schema_name | trim }}      
    {%- elif target.schema[:9] == 'dbt_cloud' -%}          
        {{ target.schema }}_{{ custom_schema_name | trim }}      
    {%- elif custom_schema_name is none -%}          
        {{ default_schema }}      
    {%- else -%}          
        {{ custom_schema_name | trim }}      
    {%- endif -%}  
{%- endmacro %}

这个宏解决了问题:

generate_schema_name.sql 
{% macro generate_schema_name(custom_schema_name, node) -%}

    {%- set default_schema = target.schema -%}

    {%- if target.name[-3:] == 'dev' -%}

        {{ target.schema }}_{{ custom_schema_name | trim }}

    {%- elif target.schema[:9] == 'dbt_cloud' -%}

        {{ target.schema }}_{{ custom_schema_name | trim }}

    {%- elif custom_schema_name is none -%}

        {{ default_schema }}

    {%- else -%}

        {{ custom_schema_name | trim }}

    {%- endif -%}

{%- endmacro %}