airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Flex Gao (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AIRFLOW-625) doc_md in concepts document seems wrong
Date Mon, 14 Nov 2016 11:47:58 GMT
Flex Gao created AIRFLOW-625:
--------------------------------

             Summary: doc_md in concepts document seems wrong
                 Key: AIRFLOW-625
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-625
             Project: Apache Airflow
          Issue Type: Bug
    Affects Versions: Airflow 1.7.1
         Environment: CentOS 7.2 
            Reporter: Flex Gao


In [https://github.com/apache/incubator-airflow/blob/master/docs/concepts.rst] it said *doc_md*
is an attribute of a task, but this will give an error on webserver *Graph* tab

Example Dag file:

{code:python}
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta

SCRIPTS_PATH = '/var/lib/airflow/scripts'

default_args = {
    'depends_on_past': False,
    'start_date': datetime(2016, 11, 9, 0, 55),
}

dag = DAG('elasticsearch', default_args=default_args, schedule_interval=timedelta(days=1))

t1 = BashOperator(
    task_id='daily_index_delete',
    bash_command='%s/es_clean.py' % SCRIPTS_PATH,
    dag=dag)

t1.doc_md = """\
#### Task Documentation
Clean ES Indeices Every Day
"""
{code}

This will give a traceback: 

*AttributeError: 'NoneType' object has no attribute 'strip'*

But if i changed *t1.doc_md* to *dag.doc_md*, everything is ok.



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

Mime
View raw message