Hi, I have a question about arrays in environment ...
# announcements
j
Hi, I have a question about arrays in environment variables. Command
meltano config tap-csv set files '[{ "entity": "example", "file": "example.csv" },{ "entity": "example2", "file": "example2.csv" }]'
writes this to `meltano.yml`:
Copy code
config:
  files:
  - entity: example
    file: example.csv
  - entity: example2
    file: example2.csv
Is there a way how to "overwrite" these values by environment variable? I know how to overwrite simple string value:
meltano config tap-csv set files ''
export TAP_CSV_FILES="simple"
meltano config tap-csv list
files [env: TAP_CSV_FILES] current value: 'simple' (from the environment)
However, is there similar approach for arrays? Command
export TAP_CSV_FILES="[{ "entity": "example", "file": "example.csv" },{ "entity": "example2", "file": "example2.csv" }]"
is not equivalent to the
meltano.yml
configuration.
Let me rephrase that: There is a difference between
meltano config tap-csv set files --*store=meltano_yml* '[{ "entity": "example", "file": "example.csv" },{ "entity": "example2", "file": "example2.csv" }]'
and
meltano config tap-csv set files *--store=dotenv* '[{ "entity": "example", "file": "example.csv" },{ "entity": "example2", "file": "example2.csv" }]'
. 🙂
store=meltano_yml
=
meltano invoke tap-csv
is working.
store=dotenv
=
meltano invoke tap-csv
returns "TypeError: string indices must be integers".
d
@jan_fertek Thanks for reporting this! You're doing everything right as described under https://meltano.com/docs/configuration.html#custom-settings (since
files
is not currently explicitly defined in
discovery.yml
: https://gitlab.com/meltano/meltano/-/issues/2345), but Meltano isn't correctly casting the environment variable's string value to an array to match the type of the custom setting in
meltano.yml
: https://gitlab.com/meltano/meltano/-/issues/2346 I'll make sure both issues are resolved in today's release 🙂
j
I'll make sure both issues are resolved in today's release 🙂
Wow, thank you so much! yay