HyukjinKwon commented on a change in pull request #24259: [SPARK-27328][SQL]
Add 'deprecated' in ExpressionDescription for extended usage and SQL doc
URL: https://github.com/apache/spark/pull/24259#discussion_r273325573
##########
File path: sql/gen-sql-markdown.py
##########
@@ -136,6 +137,27 @@ def _make_pretty_note(note):
return "**Note:**\n%s\n" % note
+def _make_pretty_deprecated(deprecated):
+ """
+ Makes the deprecated description pretty and returns a formatted string if
`deprecated`
+ is not an empty string. Otherwise, returns None.
+
+ Expected input:
+
+ ...
+
+ Expected output:
+ **Deprecated:**
+
+ ...
+
+ """
+
+ if deprecated != "":
+ deprecated = "\n".join(map(lambda n: n[4:], deprecated.split("\n")))
Review comment:
Yes, in that case it might be a problem although there look no case so far
after this fix (I skimmed the built doc).
The thing we should take into account is we shouldn't trim all the white
spaces all because spacing matters in md rendering. For instance, if we have a
doc like ..
```
object A {
@ExpressionDescription(
note = """
blabla
- first
blabla
-second
blabla
""" )
class B
}
```
We should only trim leading 6 spaces for each line. So, it will bring a bit
of complication. It's doable though.
If you don't mind, I will handle it later. Was thinking it better have a
single format for now. We should encourage to have more verbose and detailed
doc anyway (rather than single line doc) in general.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]