Searched the docs for this but couldn't find it. ...
# troubleshooting
a
Searched the docs for this but couldn't find it. If I specify something like
MY_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?
đź‘€ 1
e
Interesting! I can confirm that Meltano indeed expands it too eagerly if the
T
is set
Copy code
>>> 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:
Copy code
>>> 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:
Copy code
>>> 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 🙏?
a
Of course, I'll add tomorrow. So for now I don't think I have a workaround? Given I'm working with my own fork of the tap I can just hardcode the settings I need rather than expose through meltano config
e
Given 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 🙂
🙌 1
🙏 1
...and merged.
$
escaping will ship in the next release.
a
Wow! Thankyou!