Skip to content

Commit 1ecfac6

Browse files
committed
[SPARK-6657] [PYSPARK] Fix doc warnings
Fixed the following warnings in `make clean html` under `python/docs`: ~~~ /Users/meng/src/spark/python/pyspark/mllib/evaluation.py:docstring of pyspark.mllib.evaluation.RankingMetrics.ndcgAt:3: ERROR: Unexpected indentation. /Users/meng/src/spark/python/pyspark/mllib/evaluation.py:docstring of pyspark.mllib.evaluation.RankingMetrics.ndcgAt:4: WARNING: Block quote ends without a blank line; unexpected unindent. /Users/meng/src/spark/python/pyspark/mllib/fpm.py:docstring of pyspark.mllib.fpm.FPGrowth.train:3: ERROR: Unexpected indentation. /Users/meng/src/spark/python/pyspark/mllib/fpm.py:docstring of pyspark.mllib.fpm.FPGrowth.train:4: WARNING: Block quote ends without a blank line; unexpected unindent. /Users/meng/src/spark/python/pyspark/sql/__init__.py:docstring of pyspark.sql.DataFrame.replace:16: WARNING: Field list ends without a blank line; unexpected unindent. /Users/meng/src/spark/python/pyspark/streaming/kafka.py:docstring of pyspark.streaming.kafka.KafkaUtils.createRDD:8: ERROR: Unexpected indentation. /Users/meng/src/spark/python/pyspark/streaming/kafka.py:docstring of pyspark.streaming.kafka.KafkaUtils.createRDD:9: WARNING: Block quote ends without a blank line; unexpected unindent. ~~~ davies Author: Xiangrui Meng <[email protected]> Closes apache#6221 from mengxr/SPARK-6657 and squashes the following commits: e3f83fe [Xiangrui Meng] fix sql and streaming doc warnings 2b4371e [Xiangrui Meng] fix mllib python doc warnings
1 parent e32c0f6 commit 1ecfac6

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

python/pyspark/mllib/evaluation.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,10 @@ def ndcgAt(self, k):
334334
"""
335335
Compute the average NDCG value of all the queries, truncated at ranking position k.
336336
The discounted cumulative gain at position k is computed as:
337-
sum,,i=1,,^k^ (2^{relevance of ''i''th item}^ - 1) / log(i + 1),
337+
sum,,i=1,,^k^ (2^{relevance of ''i''th item}^ - 1) / log(i + 1),
338338
and the NDCG is obtained by dividing the DCG value on the ground truth set.
339339
In the current implementation, the relevance value is binary.
340-
341-
If a query has an empty ground truth set, zero will be used as ndcg together with
340+
If a query has an empty ground truth set, zero will be used as NDCG together with
342341
a log warning.
343342
"""
344343
return self.call("ndcgAt", int(k))

python/pyspark/mllib/fpm.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ class FPGrowth(object):
6161
def train(cls, data, minSupport=0.3, numPartitions=-1):
6262
"""
6363
Computes an FP-Growth model that contains frequent itemsets.
64-
:param data: The input data set, each element
65-
contains a transaction.
66-
:param minSupport: The minimal support level
67-
(default: `0.3`).
68-
:param numPartitions: The number of partitions used by parallel
69-
FP-growth (default: same as input data).
64+
65+
:param data: The input data set, each element contains a
66+
transaction.
67+
:param minSupport: The minimal support level (default: `0.3`).
68+
:param numPartitions: The number of partitions used by
69+
parallel FP-growth (default: same as input data).
7070
"""
7171
model = callMLlibFunc("trainFPGrowthModel", data, float(minSupport), int(numPartitions))
7272
return FPGrowthModel(model)

python/pyspark/sql/dataframe.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,7 @@ def replace(self, to_replace, value, subset=None):
943943
Columns specified in subset that do not have matching data type are ignored.
944944
For example, if `value` is a string, and subset contains a non-string column,
945945
then the non-string column is simply ignored.
946+
946947
>>> df4.replace(10, 20).show()
947948
+----+------+-----+
948949
| age|height| name|

python/pyspark/streaming/kafka.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,12 @@ def createRDD(sc, kafkaParams, offsetRanges, leaders={},
132132
.. note:: Experimental
133133
134134
Create a RDD from Kafka using offset ranges for each topic and partition.
135+
135136
:param sc: SparkContext object
136137
:param kafkaParams: Additional params for Kafka
137138
:param offsetRanges: list of offsetRange to specify topic:partition:[start, end) to consume
138139
:param leaders: Kafka brokers for each TopicAndPartition in offsetRanges. May be an empty
139-
map, in which case leaders will be looked up on the driver.
140+
map, in which case leaders will be looked up on the driver.
140141
:param keyDecoder: A function used to decode key (default is utf8_decoder)
141142
:param valueDecoder: A function used to decode value (default is utf8_decoder)
142143
:return: A RDD object

0 commit comments

Comments
 (0)