Total Complexity | 0 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # --- |
||
2 | # jupyter: |
||
3 | # jupytext: |
||
4 | # text_representation: |
||
5 | # extension: .py |
||
6 | # format_name: percent |
||
7 | # format_version: '1.1' |
||
8 | # jupytext_version: 0.8.5 |
||
9 | # kernelspec: |
||
10 | # display_name: Python 3 |
||
11 | # language: python |
||
12 | # name: python3 |
||
13 | # language_info: |
||
14 | # codemirror_mode: |
||
15 | # name: ipython |
||
16 | # version: 3 |
||
17 | # file_extension: .py |
||
18 | # mimetype: text/x-python |
||
19 | # name: python |
||
20 | # nbconvert_exporter: python |
||
21 | # pygments_lexer: ipython3 |
||
22 | # version: 3.6.7 |
||
23 | # --- |
||
24 | |||
25 | # %% |
||
26 | from airflow import DAG |
||
27 | from airflow.operators.bash_operator import BashOperator |
||
28 | from datetime import datetime, timedelta |
||
29 | |||
30 | # %% |
||
31 | default_args = { |
||
32 | 'owner': 'airflow', |
||
33 | 'depends_on_past': False, |
||
34 | 'start_date': datetime(2015, 6, 1), |
||
35 | 'email': ['[email protected]'], |
||
36 | 'email_on_failure': False, |
||
37 | 'email_on_retry': False, |
||
38 | 'retries': 1, |
||
39 | 'retry_delay': timedelta(minutes=5), |
||
40 | # 'queue': 'bash_queue', |
||
41 | # 'pool': 'backfill', |
||
42 | # 'priority_weight': 10, |
||
43 | 'end_date': datetime(2015, 6, 10), |
||
44 | } |
||
45 | |||
46 | # %% |
||
47 | dag = DAG('papermill_example', default_args=default_args) |
||
48 | |||
49 | # %% |
||
50 | t1 = BashOperator( |
||
51 | task_id='papermill_run', |
||
52 | bash_command="aiscalator jupyter run /usr/local/airflow/workspace/example/example.conf examples.papermill", |
||
53 | dag=dag) |
||
54 | |||
55 | |||
56 | # %% |
||
57 | print(dag.active_tasks) |
||
58 |