flavio_siqueira_prado
02/15/2023, 8:59 AMkind: object
with environment variables to a plugin?pat_nadolny
02/15/2023, 2:27 PMTAP_NAME_SETTING_NAME='{"key": "value"}'
(obviously substituting your names in). You can run meltano config my-tap
to make sure the config is populating as expectedflavio_siqueira_prado
02/15/2023, 2:30 PMTAP_NAME_SETTING_NAME={"special-key.*": "value"}
and I didn’t get it on the configuration file of the plugin.pat_nadolny
02/15/2023, 3:25 PMpat_nadolny
02/15/2023, 3:28 PMedgar_ramirez_mondragon
02/15/2023, 3:30 PMhmm I didnt think so but the dot looks to be causing it to be excludedEven with wrapping single quotes?
pat_nadolny
02/15/2023, 3:33 PMTAP_GOOGLE_ANALYTICS_CLIENT_SECRETS='{"special-key": "value"}' meltano config tap-google-analytics
{
"client_secrets": {
"special-key": "value"
}
}
TAP_GOOGLE_ANALYTICS_CLIENT_SECRETS='{"special-key*": "value"}' meltano config tap-google-analytics
{
"client_secrets": {
"special-key*": "value"
}
}
TAP_GOOGLE_ANALYTICS_CLIENT_SECRETS='{"special-key.*": "value"}' meltano config tap-google-analytics
{
"client_secrets": {}
}
edgar_ramirez_mondragon
02/15/2023, 3:55 PMspecial-key
and *
.Will Da Silva (Arch)
02/15/2023, 4:11 PM.
in it with Meltano? We always expand such keys into nested dictionaries in the config.Will Da Silva (Arch)
02/15/2023, 4:11 PM.
in a Meltano config key?Will Da Silva (Arch)
02/15/2023, 4:12 PM\.
doesn't get expanded, but .
does.flavio_siqueira_prado
02/15/2023, 4:12 PMjson.loads
, if you add \.
you get an error on it about the escaped \
Will Da Silva (Arch)
02/15/2023, 4:13 PM\\.
in the JSON/YAMLflavio_siqueira_prado
02/15/2023, 4:14 PM>>> import json
>>> json.loads('{"key\\.": "value"}')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/flavio.s.prado/.pyenv/versions/3.10.0/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/Users/flavio.s.prado/.pyenv/versions/3.10.0/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/flavio.s.prado/.pyenv/versions/3.10.0/lib/python3.10/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 1 column 6 (char 5)
Will Da Silva (Arch)
02/15/2023, 4:14 PMWill Da Silva (Arch)
02/15/2023, 4:15 PMtaylor
02/15/2023, 4:15 PMWill Da Silva (Arch)
02/15/2023, 4:18 PM.
for the manifest feature.Will Da Silva (Arch)
02/15/2023, 5:13 PMTAP_GOOGLE_ANALYTICS_CLIENT_SECRETS='{"special-key.*": "value"}' meltano config tap-google-analytics
{
"client_secrets": {
"special-key": {
"*": "value"
}
}
}
Or does the key actually need to be special-key.*
?Will Da Silva (Arch)
02/15/2023, 6:11 PMTAP_GOOGLE_ANALYTICS_CLIENT_SECRETS='{"special-key": {"*": "value"}}' meltano config tap-google-analytics
Will Da Silva (Arch)
02/15/2023, 6:14 PMWill Da Silva (Arch)
02/15/2023, 6:15 PM.
in it that shouldn't be expanded.aaronsteers
02/15/2023, 6:22 PMHave either of you run into this problem before? Needing aSince Meltano settings names can be anything, and sincein a Meltano config key?.
.
is a delimiter between nested config nodes, I think I'm totally okay with not supporting '.'
in setting names.
That said, if the problem is that we're trying to send a complex object to the setting and we want a passthrough ignoring dots and wildcards in the field's contents, then I can see why this from @pat_nadolny's tests above is a bug preventing that use case:
TAP_GOOGLE_ANALYTICS_CLIENT_SECRETS='{"special-key.*": "value"}' meltano config tap-google-analytics
{
"client_secrets": {}
}
aaronsteers
02/15/2023, 6:23 PMWill Da Silva (Arch)
02/15/2023, 6:25 PM.
in setting names is an okay resolution to that, I think. It should be documented as a limitation with no workarounds. It's a separate matter from the linked bug, which is about the key-value pair not being processed because of the dot.aaronsteers
02/15/2023, 6:29 PMflavio_siqueira_prado
02/15/2023, 6:51 PMtarget-redshift
setting schema_mapping
to accept a regex as a key. I wanted to do it because I have an use case of aggregating more than one schema from my tap to the same schema on redshift. As the .
is not supported I changed my fork and my PR (on redshift target) to support unix file pattern matching for now.
Btw, thank you very much guys for the great support here.flavio_siqueira_prado
02/15/2023, 7:07 PMTARGET_REDSHIFT_SCHEMA_MAPPING='{"shard.*": {"target_schema": "shards"}}'
So all schemas at my origin that would match shard.*
would have it’s tables on redshift schema shards
.
Right now I changed for shard*
, not as powerful as regex but good enough for my case.