Hello, I'm trying to use the mapper <meltano-map-t...
# plugins-general
a
Hello, I'm trying to use the mapper meltano-map-transformer to map a column that is a dictionary. Is it possible to map a the
value
of a specific
key
to
null
? I've tried a few thing but none works:
Copy code
# First try
params.field1: null

# Second try
params.['field1']: null

# Third try
params: |
  params['field1'] = None
  params
Any idea on how to achieve this?
1
r
Maybe
Copy code
params: "{**params, 'field1': None}"
or if you're using Python 3.9 or newer
Copy code
params: "params | {'field1': None}"
This might also be of interest: https://sdk.meltano.com/en/latest/stream_maps.html#compound-expressions i.e.
Copy code
params: "{k: None if k == 'field1' else v for k, v in params.items()}"
a
Thanks, I will try it!
Just tried it and it worked very well for dictionaries! Thanks
r
Awesome, no problem! 🙂