Andy Carter
07/17/2024, 4:03 PMMY_DB$TableName
in a meltano config yaml, I think the variable expansion eats it to MY_DB\ableName
. Is there a way to escape the dollar sign and avoid this?Edgar RamĂrez (Arch.dev)
07/17/2024, 5:16 PMT
is set
>>> from meltano.core.utils import expand_env_vars
>>> expand_env_vars("MY_DB$TableName", {"T": "\\"})
'MY_DB\tableName'
Removing T
from the environment won't work because it'll just be expanded to an empty string:
>>> expand_env_vars("MY_DB$TableName", {})
2024-07-17 11:10:06 [debug ] Variable '$T' is not set in the provided env dictionary.
'MY_DBableName'
There's also another mode that's not exposed to the user, but it also won't work:
>>> expand_env_vars("MY_DB$TableName", {}, if_missing=2)
2024-07-17 11:12:17 [debug ] Variable '$T' is not set in the provided env dictionary.
'MY_DB${T}ableName'
Adding an escape pattern might work, but we'd have to make it's transformed back MY_DB\\$TableName
-> MY_DB$TableName
when processed.
Would you mind creating an issue in the github repo 🙏?Andy Carter
07/17/2024, 5:55 PMEdgar RamĂrez (Arch.dev)
07/17/2024, 6:25 PMGiven I'm working with my own fork of the tap I can just hardcode the settings I need rather than expose through meltano config👍 fwiw this patch seems to work: https://gist.github.com/edgarrmondragon/a825520d22fc00a9f6911c209e23756e Just gotta find the time to add tests and make a PR 🙂
Edgar RamĂrez (Arch.dev)
07/17/2024, 8:38 PMEdgar RamĂrez (Arch.dev)
07/17/2024, 11:04 PM$
escaping will ship in the next release.Andy Carter
07/18/2024, 7:47 AM