rehan243 commented on issue #66477: URL: https://github.com/apache/airflow/issues/66477#issuecomment-4389278378
fwiw, we ran into this exact docstring formatting headache in Airflow when ramping up task decorators for some DAGs. Honestly, having to flatten the indentation just to make the doc UI look decent is super annoying and kills the readability in the codebase — especially once you have multi-line descriptions like your `In case of error you should do ...`. What worked for us was dropping in Python’s `textwrap.dedent()` right before passing the docstring to Airflow, so we didn’t have to mess with the function doc formatting. The thing is, Airflow’s web UI really doesn’t handle whitespace well, and if you’re on v2.7+ the rendering’s even fussier (we saw weird alignment with nested tasks). Not gonna lie, took us a few tries to get it consistent across local and prod. Would love to see dedent baked in upstream — we had to patch it in a custom decorator for now. There’s definitely room to clean this up, since most people will want readable DAG code *and* nice docs in the UI. -- 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]
