airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AIRFLOW-443) Code from DAGs with same __name__ show up on each other's code view in the web UI
Date Wed, 24 Aug 2016 07:06:20 GMT

    [ https://issues.apache.org/jira/browse/AIRFLOW-443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15434327#comment-15434327
] 

ASF subversion and git services commented on AIRFLOW-443:
---------------------------------------------------------

Commit ee7c6b0e9e698e52c2d08c2de06e721d0670bf90 in incubator-airflow's branch refs/heads/master
from [~bolke]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=ee7c6b0 ]

Merge branch 'AIRFLOW-443'


> Code from DAGs with same __name__ show up on each other's code view in the web UI
> ---------------------------------------------------------------------------------
>
>                 Key: AIRFLOW-443
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-443
>             Project: Apache Airflow
>          Issue Type: Bug
>            Reporter: Li Xuanji
>            Assignee: Bolke de Bruin
>
> With a dags folder containing 2 files, `bash_bash_bash/dag.py` and `bash_bash_bash_2/dag.py`,
with the following contents
> bash_bash_bash/dag.py
> ```
> from airflow import DAG
> from airflow.operators.bash_operator import BashOperator
> from datetime import datetime, timedelta
> default_args = {
>     'owner': 'airflow',
>     'depends_on_past': False,
>     'start_date': datetime(2016, 1, 1, 1, 0),
>     'email': ['xuanji@gmail.com'],
>     'email_on_failure': True,
>     'email_on_retry': False,
>     'retries': 3,
>     'retry_delay': timedelta(minutes=1),
>     'concurrency': 1,
> }
> dag = DAG('bash_bash_bash', default_args=default_args, schedule_interval=timedelta(seconds=10))
> # t1, t2 and t3 are examples of tasks created by instatiating operators
> t1 = BashOperator(
>     task_id='print_date',
>     bash_command='date',
>     dag=dag
> )
> t2 = BashOperator(
>     task_id='sleep',
>     bash_command='sleep 1',
>     retries=3,
>     dag=dag
> )
> templated_command = """
> {% for i in range(5) %}
> echo "{{ ds }}"
> echo "{{ macros.ds_add(ds, 7)}}"
> echo "{{ params.my_param }}"
> {% endfor %}
> """
> t3 = BashOperator(
>     task_id='templated',
>     bash_command=templated_command,
>     params={'my_param': 'Parameter I passed in'},
>     dag=dag
> )
> t2.set_upstream(t1)
> t3.set_upstream(t1)
> ```
> bash_bash_bash_2/dag.py
> ```
> from airflow import DAG
> from airflow.operators.bash_operator import BashOperator
> from datetime import datetime, timedelta
> default_args = {
>     'owner': 'airflow',
>     'depends_on_past': False,
>     'start_date': datetime(2016, 1, 1, 1, 0),
>     'email': ['xuanji@gmail.com'],
>     'email_on_failure': True,
>     'email_on_retry': False,
>     'retries': 3,
>     'retry_delay': timedelta(minutes=1),
>     'concurrency': 1,
> }
> dag = DAG('bash_bash_bash_2', default_args=default_args, schedule_interval=timedelta(seconds=10))
> t1 = BashOperator(
>     task_id='print_date',
>     bash_command='date',
>     dag=dag
> )
> ```
> The code view in the web UI shows the contents of bash_bash_bash_2/dag.py  for both DAGs



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message