The documentation outlines 5 attributes "doc, doc_json, doc_yaml, doc_md, 
doc_rst", but as best as I can tell only "doc_md" does anything and it the only 
1 listed in the DAG class: 
https://github.com/apache/airflow/blob/4e03d2390fc77e6a911fb97d8585fad482c589a6/airflow/models/dag.py#L204
 

I tried setting the doc_yaml attribute, as all my config files are yaml, but 
there was no evidence in the UI that anything changed (tested on 1.10.3 and 
1.10.4). Am I missing something or is this just incorrectly documented?

For the working attribute "doc_md" it appears as a text box above the graph. 
For my larger YAML files which are currently ~200 lines, putting this YAML 
contents in to this box makes this page a significantly worse user experience 
as you have to scroll down through 200 lines of config every time you want to 
view the graph.

If the documented attributes worked and there was a maximum height on the 
documentation text box where you would scroll after that it would definitely be 
workable. But this feels wrong to me as it isn't documentation and I would like 
the user to be able to specify actual documentation there. In my use case from 
the users point of view the YAML file is the "code" that makes the DAG.

Damian

-----Original Message-----
From: Kamil Breguła [mailto:kamil.breg...@polidea.com] 
Sent: Tuesday, August 13, 2019 6:19 PM
To: dev@airflow.apache.org
Subject: Re: Manipulating the DAG Code View?

It seems to me that a better idea would be to add documentation to DAG.
https://airflow.readthedocs.io/en/latest/concepts.html?highlight=doc_md#documentation-notes

On Tue, Aug 13, 2019 at 8:55 PM Shaw, Damian P.
<damian.sha...@credit-suisse.com> wrote:
>
> As Ash says, I tried creating some test DAGs in 1.10.x and found that they 
> didn't run. There wasn't even any obvious error, Airflow loaded the file (I 
> could see pyc created) but it never appeared in the DAG bag.
>
> Damian
>
> -----Original Message-----
> From: Ash Berlin-Taylor [mailto:a...@apache.org]
> Sent: Tuesday, August 13, 2019 2:47 PM
> To: dev@airflow.apache.org; Chris Palmer
> Subject: Re: Manipulating the DAG Code View?
>
> Be carefully doing that in 1.10.4 - if you change that you may find your dags 
> don't run anymore!
>
> On 13 August 2019 19:46:01 BST, Chris Palmer <ch...@crpalmer.com> wrote:
> >A more involved PR like you suggest might be valuable in the long run,
> >but
> >in the short term I've been successful in the past with simply
> >modifying
> >the fileloc attribute of DAGs. It get's set here
> ><https://github.com/apache/airflow/blob/master/airflow/models/dag.py#L229>
> >to the previous frame, but you could override it once you've created
> >the
> >DAG object.
> >
> >Chris
> >
> >On Tue, Aug 13, 2019 at 2:31 PM Shaw, Damian P. <
> >damian.sha...@credit-suisse.com> wrote:
> >
> >> Hi all,
> >>
> >> I'm in need of being able to manipulate the code view for many of my
> >DAGs
> >> which are generated by a single Python script that reads config
> >files. My
> >> DAG creation script is getting increasingly less useful to the end
> >users so
> >> I would like to instead present the config file that was used to
> >generate
> >> the DAG.
> >>
> >> I took a look at the relevant code vide code in Airflow:
> >>
> >https://github.com/apache/airflow/blob/3e2a02751cf890b780bc26b40c7cee7f1f4e0bd9/airflow/www/views.py#L433
> >>
> >> It seems it would be a relatively easy change to add an extra option
> >on
> >> the DAG, e.g. "dag.code_display_file" and maybe also a Lexer option,
> >then
> >> detect if this option has been set for the DAG in the above location
> >and
> >> display the specified file instead.
> >>
> >> I don't have any experience contributing to open source projects of
> >this
> >> size, would this be a welcome pull request? I'd rather not waste
> >anyone's
> >> time if it isn't.
> >>
> >> Thanks,
> >> Damian
> >>
> >>
> >===============================================================================
> >>
> >> Please access the attached hyperlink for an important electronic
> >> communications disclaimer:
> >> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> >>
> >===============================================================================
> >>
> >>
>
>
> ===============================================================================
> Please access the attached hyperlink for an important electronic 
> communications disclaimer:
> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> ===============================================================================


=============================================================================== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=============================================================================== 

Reply via email to