[
https://issues.apache.org/jira/browse/AIRFLOW-625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15838399#comment-15838399
]
Daniel Huang commented on AIRFLOW-625:
--------------------------------------
I wasn't able to reproduce this.
Did you by chance have {{dag.doc_md = __doc__}} set (like
https://github.com/apache/incubator-airflow/blob/master/docs/concepts.rst does)
when you first tried this? Maybe DAG did not refresh on your latest example
attempt? That would have triggered this error since you don't have any
docstrings set. Also in that case, changing {{t1.doc_md}} to {{dag.doc_md}}
would have fixed your issue because then {{dag.doc_md}} was no longer {{None}}.
> 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}
> #!/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)