@@ -489,8 +489,9 @@ def sort(self, *cols, **kwargs):
489489 """Returns a new :class:`DataFrame` sorted by the specified column(s).
490490
491491 :param cols: list of :class:`Column` or column names to sort by.
492- :param ascending: sort by ascending order or not, could be bool, int
493- or list of bool, int (default: True).
492+ :param ascending: boolean or list of boolean/int (default True).
493+ Sort ascending vs. descending. Specify list for multiple sort orders.
494+ If a list is specified, length of the list must equal length of the `cols`.
494495
495496 >>> df.sort(df.age.desc()).collect()
496497 [Row(age=5, name=u'Bob'), Row(age=2, name=u'Alice')]
@@ -519,7 +520,7 @@ def sort(self, *cols, **kwargs):
519520 jcols = [jc if asc else jc .desc ()
520521 for asc , jc in zip (ascending , jcols )]
521522 else :
522- raise TypeError ("ascending can only be bool or list, but got %s" % type (ascending ))
523+ raise TypeError ("ascending can only be boolean or list, but got %s" % type (ascending ))
523524
524525 jdf = self ._jdf .sort (self ._jseq (jcols ))
525526 return DataFrame (jdf , self .sql_ctx )
0 commit comments