Dagster-meltano (Under development)
A dagster plugin that allows you to run Meltano pipelines using Dagster.
Installation
- Install using pip
pip install dagster-meltano
. - Make sure you have an installed Meltano project.
- Point the plugin to the root of the Meltano project by defining
MELTANO_PROJECT_ROOT
.
Example
An example of a Dagster pipeline that runs a Meltano elt process.
from dagster import OutputDefinition, Nothing
from dagster_meltano.tests import pipeline
from dagster_meltano.solids import meltano_elt_solid
@pipeline
def meltano_pipeline():
meltano_elt_solid(
output_defs=[OutputDefinition(dagster_type=Nothing)],
tap='tap-csv',
target='target-jsonl',
job_id='csv-to-jsonl' # Optional
)
Development
Setup using VSCode
- Open this repository in Visual Studio Code.
- Install the Remote - Containers plugin for Visual Studio Code.
- Wait for the container setup, it should automatically install all Meltano plugins.
- Open the integrated terminal and start Dagit
dagit -f dagster_meltano/tests/pipeline.py
- Visit
localhost:3000
to access Dagit.
Setup using other IDEs
- Create a virtual environment
- Pip install dependencies:
pip install dagster meltano
- Install Meltano plugins:
cd meltano && meltano install && cd ..
- Set env vars:
export MELTANO_PROJECT_ROOT=<path/to/meltano>
- Run dagit:
dagit -f dagster_meltano/tests/pipeline.py
Testing and Linting
We use Dagster's default setup for testing and linting.
Linting
Specifically linting can be accomplished by installing the appropriate linters:
pip install black pylint isort
And then running them against the codebase:
black dagster_meltano/ && isort dagster_meltano/ && pylint dagster_meltano/