Skip to content

Commit ae9e01d

Browse files
committed
fix test
1 parent 9106585 commit ae9e01d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

python/pyspark/sql/dataframe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ def crosstab(self, col1, col2):
915915
Computes a pair-wise frequency table of the given columns. Also known as a contingency
916916
table. The number of distinct values for each column should be less than 1e4. The first
917917
column of each row will be the distinct values of `col1` and the column names will be the
918-
distinct values of `col2`. Pairs that have no occurrences will have `null` as their values.
918+
distinct values of `col2`. Pairs that have no occurrences will have `null` as their counts.
919919
:func:`DataFrame.crosstab` and :func:`DataFrameStatFunctions.crosstab` are aliases.
920920
921921
:param col1: The name of the first column. Distinct items will make the first item of

python/pyspark/sql/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def test_cov(self):
408408
def test_crosstab(self):
409409
df = self.sc.parallelize([Row(a=i % 3, b=i % 2) for i in range(1, 7)]).toDF()
410410
ct = df.stat.crosstab("a", "b").collect()
411-
ct = sorted(ct, lambda r: r[0])
411+
ct = sorted(ct, key=lambda x: x[0])
412412
for i, row in enumerate(ct):
413413
self.assertEqual(row[0], str(i))
414414
self.assertTrue(row[1], 1)

sql/core/src/main/scala/org/apache/spark/sql/DataFrameStatFunctions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ final class DataFrameStatFunctions private[sql](df: DataFrame) {
6868
* The number of distinct values for each column should be less than 1e4. The first
6969
* column of each row will be the distinct values of `col1` and the column names will be the
7070
* distinct values of `col2`. Counts will be returned as `Long`s. Pairs that have no occurrences
71-
* will have `null` as their values.
71+
* will have `null` as their counts.
7272
*
7373
* @param col1 The name of the first column. Distinct items will make the first item of
7474
* each row.

0 commit comments

Comments
 (0)