ken_payne
08/02/2023, 4:53 PMmappers folder full of .py files. Each file imports and subclasses a BaseMapper class, and we crawl the dir at the beginning of each run looking for the available custom mappers (similar to the Airflow DagBag concept). That way mappers are code, included in the Meltano Project and as lightweight as possible. On the backend we may still need to create a venv for the discovered mappers, and allow users to define requirements/dependencies for cases when a user wants to leverage 3rd party libraries/sdk (e.g. OpenAI 🤯 ) in custom mappers.pat_nadolny
08/02/2023, 5:01 PMpat_nadolny
08/02/2023, 5:07 PMEach file imports and subclasses a BaseMapper class like you suggested for consistency) then they could create many distinct instance of that plugin using inherit_from pointing to different scripts, and potentially appending new dependencies directly to the pip_url although I dont think you can install the same plugin twice right now so it doesnt solve the separate venvs problem 🤔.pat_nadolny
08/02/2023, 5:23 PM- name: generic-mapper
variant: meltano
pip_url: git+<https://github.com/MeltanoLabs/generic-mapper.git>
mappings:
- name: clean-html
config:
code_path: $MELTANO_PROJECT_ROOT/mappers/generic-mapper/clean-html.py
- name: add-embeddings
config:
code_path: $MELTANO_PROJECT_ROOT/mappers/generic-mapper/add-embeddings.py
- name: generic-mapper-child
inherit_from: generic-mapper
pip_url: git+<https://github.com/MeltanoLabs/generic-mapper.git> nltk
mappings:
- name: nltk
config:
code_path: $MELTANO_PROJECT_ROOT/mappers/generic-mapper/nltk-clean.py