aritra24 commented on code in PR #50142:
URL: https://github.com/apache/airflow/pull/50142#discussion_r2075801357


##########
task-sdk/src/airflow/sdk/definitions/dag.py:
##########
@@ -185,7 +185,18 @@ def _convert_doc_md(doc_md: str | None) -> str | None:
                 return fh.read()
         except FileNotFoundError:
             return doc_md
+    return doc_md
+
 
+def _clean_doc_md(doc_md: str) -> str:
+    # alternative to using math.inf, the linter doesn't like inf being a float
+    strip_count = len(doc_md)
+
+    for line in doc_md.split("\n"):
+        if line != "":
+            strip_count = min(strip_count, len(line) - len(line.lstrip()))
+    if strip_count > 0:
+        doc_md = "\n".join([line[strip_count:] for line in doc_md.split("\n")])

Review Comment:
   @pierrejeambrun, we wouldn't in that case be able to differentiate between 
the comment doc vs passing doc directly? Assuming no one uses extra leading 
spaces in their doc it should be fine...



-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to