Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17737#discussion_r112861995
  
    --- Diff: python/pyspark/sql/column.py ---
    @@ -337,26 +381,39 @@ def isin(self, *cols):
             return Column(jc)
     
         # order
    -    asc = _unary_op("asc", "Returns a sort expression based on the"
    -                           " ascending order of the given column name.")
    -    desc = _unary_op("desc", "Returns a sort expression based on the"
    -                             " descending order of the given column name.")
    +    _asc_doc = """
    +    Returns a sort expression based on the ascending order of the given 
column name
    +
    +    >>> from pyspark.sql import Row
    +    >>> df2 = spark.createDataFrame([Row(name=u'Tom', height=80), 
Row(name=u'Alice', height=None)])
    +    >>> df2.select(df2.name).orderBy(df2.name.asc()).collect()
    +    [Row(name=u'Alice'), Row(name=u'Tom')]
    +    """
    +    _desc_doc = """
    +    Returns a sort expression based on the descending order of the given 
column name.
    +
    +    >>> from pyspark.sql import Row
    +    >>> df2 = spark.createDataFrame([Row(name=u'Tom', height=80), 
Row(name=u'Alice', height=None)])
    +    >>> df2.select(df2.name).orderBy(df2.name.desc()).collect()
    +    [Row(name=u'Tom'), Row(name=u'Alice')]
    +    """
    +
    +    asc = ignore_unicode_prefix(_unary_op("asc", _asc_doc))
    +    desc = ignore_unicode_prefix(_unary_op("desc", _desc_doc))
     
         _isNull_doc = """
    -    True if the current expression is null. Often combined with
    -    :func:`DataFrame.filter` to select rows with null values.
    --- End diff --
    
    `Often combined with :func:`DataFrame.filter` to select rows with null 
values.` was removed because it looks applying to many other APIs and look too 
much. It just follows Scala one now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to