Skip to content

[BUG] Exposures with names set dynamically by variables get incorrectly "fixed" #241

@QMalcolm

Description

@QMalcolm

People can dynamically set the name of an exposure by doing something like the following:

# my_exposure.yaml
exposures:
  - name: "{{ env_var('DBT_ENV_EXPOSURE_NAME_PREFIX') }}_my_exposure"
     ...

In dbt-core, we don't issue a ExposureNameDeprecation deprecation for this because we resolve the env var, and then validate that the resolved templated name is valid. However, in dbt-autofix we don't resolve the env var, view the name as having invalid characters, and attempt to "fix" it. In the above example exposure, autofix will "fix" the name to be _env_varDBT_ENV_EXPOSURE_NAME_PREFIX__my_exposure 😬

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions