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_r270749478
##########
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:
@cloud-fan, for instance this logic matters.
If we put some strings in ..
```scala
@ExpressionDescription(
...
deprecated = """
blah blah blah
I am super long line
1. one
2. I am markdwn
- bullet marks
- aa
You know what? actually you can write a markdown table as well.
| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
""")
```
`gen-sql-markdown.py` here split the doc into each line and then get rid of
the first 4 characters for each. Last newline makes a proper indentation
between each field.
----------------------------------------------------------------
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]