potiuk commented on code in PR #25509:
URL: https://github.com/apache/airflow/pull/25509#discussion_r937998040
##########
airflow/models/dag.py:
##########
@@ -522,17 +522,35 @@ def __init__(
self.has_on_success_callback = self.on_success_callback is not None
self.has_on_failure_callback = self.on_failure_callback is not None
- self.doc_md = doc_md
-
self._access_control =
DAG._upgrade_outdated_dag_access_control(access_control)
self.is_paused_upon_creation = is_paused_upon_creation
self.jinja_environment_kwargs = jinja_environment_kwargs
self.render_template_as_native_obj = render_template_as_native_obj
+
+ self.doc_md = self.get_doc_md(doc_md)
+
self.tags = tags or []
self._task_group = TaskGroup.create_root(self)
self.validate_schedule_and_params()
+ def get_doc_md(self, doc_md: str) -> str:
+ if doc_md is None:
+ return doc_md
+
+ env = self.get_template_env(force_sandboxed=False)
+
+ if not doc_md.endswith('.md'):
Review Comment:
Yep. Not nice if yoy really wanted your documentation end with ".md" :D. I
think I'd prefer in this case to continue running but simply to use the "your
documentation,md" as the content of the doc. I don't think failing DAG parsing
in this case is justified.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]