#7741 bug: env variable defined in schedule scope does not have any affect
Issue created by
mertbakir
### Meltano Version
2.18.0
### Python Version
3.9
### Bug scope
Configuration (settings parsing, validation, etc.)
### Operating System
Linux - Ubuntu 22.04
### Description
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:
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.
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.
### Code
No response
meltano/meltano