cloud-fan 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_r273316356
##########
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:
what if the expression is inside an object? e.g.
```
object A {
@ExpressionDescription(
note = """
blabla
""" )
class B
}
```
Then the string has 6 spaces at the beginning.
It looks to me that we can relax the format a little bit: just trim all the
spaces at the beginning. Then we can even use a single line string.
----------------------------------------------------------------
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]