```plugins: transformers: - name: dbt-postgres...
# troubleshooting
m
Copy code
plugins:
  transformers:
  - name: dbt-postgres
    variant: dbt-labs
    pip_url: dbt-core~=1.5.0 dbt-postgres~=1.5.0
    commands:
      run_dynamic_env:
        args: run --target ${DBT_TARGET_ENV}
jobs:
- name: run-dbt--full
  tasks:
  - dbt-postgres:clean dbt-postgres:run_dynamic_env
schedules:
- name: schedule01
  interval: 00 23 * * *
  job: run-dbt--full
  env:
    DBT_TARGET_ENV: target_name
I want to create the same schedule for different targets, so I thought I can leverage schedule level env variables but it doesn't work:
Copy code
Run invocation could not be completed as block failed: Cannot start plugin: Command 'run_dynamic_env' referenced unset environment variable '${DBT_TARGET_ENV}' in an argument. Set the environment variable or update the command definition.
The variable
DBT_TARGET_ENV
is not defined anywhere else but only at the schedule level. When I define it on root plugin level it does not get overridden by the schedule level definition. Same applies to .env file. Meltano picks up the variable from root plugin level and .env file but not from schedule. meltano, version 2.18.0
Without the variable I have to define N plugin commands then N jobs then N schedules which makes 3x more definition of the same thing.
Can anyone help me with this? Do you think my configuration is wrong?
p
Can you open an issue for this? Based on https://docs.meltano.com/guide/configuration#environment-variables it looks like thsi hsould be supported although I know theres this open issue https://github.com/meltano/meltano/issues/3171 that might be affecting the commands, I'm not sure 🤔 . cc @cody_hanson since you worked on env var expansion previously