chrish
01/30/2023, 12:59 PMtype
for a property-level transformation?
I want to replace some unicode characters that psycopg2 doesn't like. It looks like I can do this with Inline Stream Maps.
The PR for the feature shows a couple of different types: MASK-HIDDEN
and lowercase
, but searching through the source I'm not seeing where the functionality of those types is defined.
Approach suggested by @thomas_briggs: (thanks!)
https://meltano.slack.com/archives/C01TCRBBJD7/p1674916619997379thomas_briggs
01/30/2023, 1:45 PMchrish
01/30/2023, 2:01 PMmd5
in the example is not a default function in python so kept looking and found Property-level transformations,
I think my transform code is going to be pretty simple, but if it gets more complex, is there a way to define my own functions outside of meltano.yml?thomas_briggs
01/30/2023, 2:15 PMchrish
01/30/2023, 2:27 PMextractor -> mapper -> extractor > loader
?thomas_briggs
01/30/2023, 2:35 PM__else__
element? I think that applies to all fields that don't have an explicit mapping.chrish
01/30/2023, 2:38 PMthomas_briggs
01/30/2023, 3:00 PMedgar_ramirez_mondragon
01/30/2023, 4:45 PMI think my transform code is going to be pretty simple, but if it gets more complex, is there a way to define my own functions outside of meltano.yml?Not really, other than contributing them to the SDK or spinning out your own mapper plugin. See (sdk#1175 and meltano-map-transform#11).
Can I apply the map to an entire record/stream(?) at a time?As the comments above suggest,
__else__
at the property level is a good candidate to implement this, but I don’t think there’s any issue open for it, so feel free to log one 🙂chrish
01/31/2023, 1:47 PMchrish
01/31/2023, 1:50 PMextractor -> mapper -> extractor > loader
?
I'm wondering if I can read the file w/o splitting into fields, apply the map, then read the stream and split the fields, then load the data.edgar_ramirez_mondragon
01/31/2023, 8:20 PM{"schema": {"properties": {"line": {"type": "string"}}}}
{"record": {"line": "a,csv,line,with,bad,chars"}}
You could certainly do that but that’d probably require a custom tap (could be a .py script) and you’d also need to dump it somewhere (so, a target)