Created
July 17, 2019 20:10
-
-
Save natekupp/5ab6a04a6a11b4e60aa9608be9bf7af7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example_airflow.py | |
from dagster import lambda_solid, pipeline | |
@lambda_solid | |
def hello_world(): | |
return "hello, world" | |
@pipeline | |
def basic_pipeline(): | |
hello_world() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
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