johannes_rudolph
02/03/2023, 10:55 AMmeltano.x.yml
files?
Basically I want to co-locate the mappings with their source, so I have meltano.foo.yml
plugins:
mappers:
- name: meltano-map-transformer
mappings:
- name: FOO
and then another meltano.bar.yml file with
plugins:
mappers:
- name: meltano-map-transformer
mappings:
- name: BAR
It seems I can't figure this out as meltano complains I redefine the meltano-map-transformer. But i can also not figure out how to add 2 independent instances of the transfomer either.umar_saleem
02/03/2023, 11:20 AMinherit_from: meltano-map-transformer
johannes_rudolph
02/03/2023, 12:24 PM$loader $mapping $target
and never declare which mapper the mapping is from?umar_saleem
02/03/2023, 12:56 PMumar_saleem
02/03/2023, 12:58 PMaaronsteers
02/03/2023, 4:06 PMaaronsteers
02/03/2023, 4:06 PMscott_goering
02/06/2023, 3:59 PMdayforce
and freshservice
.
The main declaration yml file:
plugins:
mappers:
- name: meltano-map-transformer
pip_url: git+<https://github.com/MeltanoLabs/meltano-map-transform.git@v0.2.0>
mappings:
- name: dayforce
config:
stream_maps:
employees:
__alias__: ZKEYS_EMPLOYEES
XRefCode: XRefCode
__else__: null
The child:
plugins:
mappers:
- name: meltano-map-transformer--new
inherit_from: meltano-map-transformer
mappings:
- name: freshservice
config:
stream_maps:
tickets:
__alias__: ZKEYS_TICKETS
id: id
The above configuration works, but is not what we're actually trying to achieve.
Second, the failure: We are trying to drop all fields except the id
field, so we added an __else__: null
to the stream_maps
configuration in the child. Then, the child configuration looks like this:
plugins:
mappers:
- name: meltano-map-transformer--new
inherit_from: meltano-map-transformer
mappings:
- name: freshservice
config:
stream_maps:
tickets:
__alias__: ZKEYS_TICKETS
id: id
__else__: null
When we run the meltano job with the second configuration, it fails with a KeyError: 'stream_maps.tickets.__else__'
error. I've attached a log file from a recent run with the error.
If we move the whole 'freshservice' configuration back to one file and remove the inheritence, the same configuration works. It looks like this:
plugins:
mappers:
- name: meltano-map-transformer
pip_url: git+<https://github.com/MeltanoLabs/meltano-map-transform.git@v0.2.0>
mappings:
- name: dayforce
config:
stream_maps:
employees:
__alias__: ZKEYS_EMPLOYEES
XRefCode: XRefCode
__else__: null
- name: freshservice
config:
stream_maps:
tickets:
__alias__: ZKEYS_TICKETS
id: id
__else__: null
TL;DR: Explicit inheritance works! Except if we try to declare an __else__
mapping.aaronsteers
02/06/2023, 6:54 PM__else__: 'NULL'
- sending a string text "NULL" instead of an actual null value?aaronsteers
02/06/2023, 6:56 PM'__NULL__'
aaronsteers
02/06/2023, 6:57 PMscott_goering
02/06/2023, 7:07 PMscott_goering
02/07/2023, 9:15 PM'else'
portion of mapper config:
'__null__'
"__null__"
'__NULL__'
"__NULL__"
__NULL__
__null__
The error is always singer_sdk.exceptions.ConfigValidationError: Config validation failed: '__NULL__' is not of type 'null'
edgar_ramirez_mondragon
02/08/2023, 1:15 AMscott_goering
02/08/2023, 11:10 AM__NULL__
, and ran the job ā and it ran successfully!
I sent the commit link and info to the rest of the team to try in a 'real' project. I think we are good to go!
Thanks for the super fast response. This is just one of the reasons why I love the Meltano team and community!