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

    https://github.com/apache/spark/pull/13194#discussion_r82877590
  
    --- Diff: python/pyspark/ml/evaluation.py ---
    @@ -311,19 +330,25 @@ def setParams(self, predictionCol="prediction", 
labelCol="label",
     
     if __name__ == "__main__":
         import doctest
    +    import tempfile
    +    import pyspark.ml.evaluation
         from pyspark.sql import SparkSession
    -    globs = globals().copy()
    +    globs = pyspark.ml.evaluation.__dict__.copy()
         # The small batch size here ensures that we see multiple batches,
         # even in these small test examples:
         spark = SparkSession.builder\
             .master("local[2]")\
             .appName("ml.evaluation tests")\
             .getOrCreate()
    -    sc = spark.sparkContext
    -    globs['sc'] = sc
         globs['spark'] = spark
    -    (failure_count, test_count) = doctest.testmod(
    -        globs=globs, optionflags=doctest.ELLIPSIS)
    -    spark.stop()
    -    if failure_count:
    -        exit(-1)
    --- End diff --
    
    should there still be an `exit(-1)` when failures?  If not then you can 
remove the returned variables from `doctest.testmod`


---
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