You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "josh-fell (via GitHub)" <gi...@apache.org> on 2023/02/07 05:12:01 UTC

[GitHub] [airflow] josh-fell commented on a diff in pull request #29399: Persist DAG and task doc values in TaskFlow API if explicitly set

josh-fell commented on code in PR #29399:
URL: https://github.com/apache/airflow/pull/29399#discussion_r1098184082


##########
airflow/decorators/base.py:
##########
@@ -315,7 +315,9 @@ def __call__(self, *args: FParams.args, **kwargs: FParams.kwargs) -> XComArg:
             multiple_outputs=self.multiple_outputs,
             **self.kwargs,
         )
-        if self.function.__doc__:
+        op_doc_attrs = [op.doc, op.doc_json, op.doc_md, op.doc_rst, op.doc_yaml]
+        # Set the task's doc_md to the function's docstring if it exists and no other doc* args are set.
+        if self.function.__doc__ and not any(op_doc_attrs):

Review Comment:
   Checking against _all_ of the doc attrs for tasks rather than just `doc_md`. Thinking users most likely wouldn't set more than one of these at a time.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org