quinn_batten
09/27/2022, 9:33 PMquinn_batten
09/27/2022, 9:35 PMenvironments:
- name: dev
config:
database_uri: <postgresql://test:test@test.com:5432/postgres>
plugins:
loaders: ...
If I set it like this is raises an error, __init__() got an unexpected keyword argument 'database_uri' :
environments:
- name: dev
database_uri: <postgresql://test:test@test.com:5432/postgres>
config:
plugins:
loaders: ...Will Da Silva (Arch)
09/27/2022, 9:36 PMMELTANO_DATABASE_URI should do the trick. You can see the corresponding env vars for each Meltano setting by running meltano config meltano list.visch
09/27/2022, 11:19 PMmeltano --environment=dev config target-postgres database_uri abcdefg
And env is really overloaded at the moment so it's hard to understand what you're after exactly, but I've been through that exact pain and the config command above leads you to
environments:
- name: prod
config:
plugins:
extractors:
- name: tap-name
config:
config_key: config_value
loaders:
- name: target-azuread
config:
config_key: config_value
utilities:
- name: autoidm-transform
env:
EMAIL_SUFFIX: '@abc.com'
- name: dev
config:
plugins:
utilities:
- name: autoidm-transform
env:
EMAIL_SUFFIX: '@testabc.onmicrosoft.com'
As you can see env (OS Environment variables) ,.env (a file on the os) ,env as a shorthand for environments , and the env key listed above makes it hard to answer your question 😄visch
09/27/2022, 11:22 PMquinn_batten
09/28/2022, 12:10 AMMELTANO_ENVIRONMENT env var in order to switch environments, without any other finicky changesquinn_batten
09/28/2022, 12:14 AMquinn_batten
09/28/2022, 12:15 AMquinn_batten
09/28/2022, 12:16 AMvisch
09/28/2022, 12:20 AMhttps://meltano.slack.com/archives/C01TCRBBJD7/p1664324061356579?thread_ts=1664314402.975189&cid=C01TCRBBJD7I think what you mean is you want to set the
database_uri config value for your target . Which isn't under the env block it's under the config block as I showed above.
Is that not working for you? If not please share your meltano.ymlpat_nadolny
09/28/2022, 11:46 AMquinn_batten
09/28/2022, 3:35 PMquinn_batten
09/28/2022, 3:37 PMquinn_batten
09/28/2022, 3:44 PMpat_nadolny
09/28/2022, 3:47 PMI want my dev environment to point at a different meltano system database than prod, so that a dev run of a pipeline doesnt affect prod state for that same pipeline. (I don’t think meltano handles that sort of differentiation automatically, right?)This is actually already a thing depending on the version of meltano that youre on. The state IDs include your environment name if you're using
meltano run see the docs for format https://docs.meltano.com/reference/command-line-interface#runquinn_batten
09/28/2022, 3:55 PMruns table, which I think is where state is tracked (I’m on Meltano v2.4). The job_name column is just the name of the pipeline w/out anything else, the payload doesnt reference environments either. The only thing I see that could maybe be separated by environment is run_id, but I think that’s unique on the run, not the pipeline/jobquinn_batten
10/04/2022, 6:53 PM