Skip to content

Instantly share code, notes, and snippets.

@natekupp
Created July 17, 2019 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natekupp/5ab6a04a6a11b4e60aa9608be9bf7af7 to your computer and use it in GitHub Desktop.
Save natekupp/5ab6a04a6a11b4e60aa9608be9bf7af7 to your computer and use it in GitHub Desktop.
# example_airflow.py
from dagster import lambda_solid, pipeline
@lambda_solid
def hello_world():
return "hello, world"
@pipeline
def basic_pipeline():
hello_world()
'''
example_create_dag.py
The airflow DAG
'''
import os
from dagster import ExecutionTargetHandle
from dagster_airflow.factory import make_airflow_dag_for_handle
airflow_dags_path = os.path.dirname(os.path.abspath(__file__))
dag, steps = make_airflow_dag_for_handle(
ExecutionTargetHandle.for_pipeline_python_file(
python_file=os.path.join(airflow_dags_path, 'example_airflow.py'), fn_name='basic_pipeline'
),
'basic_pipeline',
environment_dict={'storage': {'filesystem': {}}},
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment