I created a custom mapper using cookiecutter and c...
# meltano-plugin-development
d
I created a custom mapper using cookiecutter and copying the code in meltano_map_transformer with a custom PluginMapper implementation. Debugging the code works great and I have the expected output showing up. Now I'm trying to add it to our project, and I'm wondering how to correctly do that. Here is the relevant part in my meltano.yml, which was added when I ran
meltano add --custom mapper column_mapper
Copy code
mappers:
  - name: column-mapper
    namespace: column_mapper
    pip_url: -e map/column-mapper
    executable: column-mapper
And my project structure attached. When I run
meltano run tap-mssql column-mapper target-snowflake --state-id-suffix dbo-test
, I get the following error:
Copy code
Environment 'default' is active
Found unexpected mapper plugin name.  plugin_name=column-mapper
Need help fixing this problem? Visit <http://melta.no/> for troubleshooting steps, or to
join our friendly Slack community.

block violates set requirements: Expected unique mappings name not the mapper plugin name: column-mapper.
What am I doing wrong here?
v
Mappers are a bit weird https://docs.meltano.com/guide/mappers/#example-1 Take a look at this meltano.yml example and I think you'll see it, there's a
mappings
key you're missing
d
Just realized I cut off the top of the project directory screenshot. Here's the full one
I updated the meltano.yml to
Copy code
mappers:
  - name: column-mapper
    namespace: column_mapper
    pip_url: -e map/column-mapper
    executable: column-mapper
    mappings:
    - name: snake_case
Still the same error though
Hang on, let me try adding more
Yeah, I don't think I'm up to that error yet. Updated to this and still getting the same thing:
Copy code
mappers:
  - name: column-mapper
    namespace: column_mapper
    pip_url: -e map/column-mapper
    executable: column-mapper
    mappings:
    - name: snake_case
      config:
        stream_maps:
If it was running and stream_maps was missing, it should instead show this:
Copy code
2024-09-05 16:56:51,576 | ERROR    | column-mapper        | Config validation error: 'stream_maps' is a required property
Ha, turns out it was just my reading. The command is supposed to use mapping name, not the mapper name.
👍 1