Open chmnata opened 1 year ago
What do yall think? Feel free to modify and comment! @tahaislam @radumas @gabrielwol
That looks pretty good. We need to note that some DAGs loads more than just one dataset into different tables. Also, some DAGs are externally triggered, i.e., their frequency depends on the external trigger frequency. We can add this at the end of the description.
Another suggestion for DAGs documentation, I added the DAG description (in some DAGs) at the top of the file as the docstring of the file and then assigned it to the DAG markdown doc using doc_md=__doc__
. This would also help us while working directly on the code. What do you think?
would there be a way to ensure that the doc_md
is somehow also synced with the README?
Could there be a way to load it from the README.md 🤔
would there be a way to ensure that the
doc_md
is somehow also synced with the README?Could there be a way to load it from the README.md 🤔
Figured out a solution using regex!
doc_md_path = os.path.join(repo_path, 'volumes/vds/readme.md')
contents = open(doc_md_path, 'r').read()
doc_md_regex = '(?<=### vds_pull_vdsvehicledata DAG \n)[\s\S]+(?=#{1,3} )'
DOC_MD = re.findall(doc_md_regex, contents)[0]
So that's something like "starts with '### vds_pull_vdsvehicledata DAG' and then everything until the next heading"?
Exactly! Feels like a manageable amount of regex to figure out per DAG. Happy to set it up initially.
we could hide a key in html comments (like to turn an entry off for the table of contents <!-- omit in toc -->
) that we wrap around the doc_md portion of the README to standardize the code. e.g.:
<!-- #doc_md -->
### vds_pull_vdsvehicledata DAG
and so on ...
<!-- #doc_md -->
We can now create Markdown-based DAG documentation that appears in the Airflow UI, we should standardize them across all of our dags. https://docs.astronomer.io/learn/custom-airflow-ui-docs-tutorial
For Dag level doc, proposing:
example:
For task level doc:
example: