aritra24 commented on code in PR #50142:
URL: https://github.com/apache/airflow/pull/50142#discussion_r2075104420
##########
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:
Oh I wasn't aware of the function, can replace. Do we want to move it away
from the serialization location? Is there any merit in having the whitespaces
in the db?
--
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]