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

    https://github.com/apache/spark/pull/21501#discussion_r194298446
  
    --- Diff: python/pyspark/ml/feature.py ---
    @@ -2610,6 +2610,9 @@ def setParams(self, inputCol=None, outputCol=None, 
stopWords=None, caseSensitive
             Sets params for this StopWordRemover.
             """
             kwargs = self._input_kwargs
    +        if locale is None:
    +            sc = SparkContext._active_spark_context
    +            kwargs['locale'] = 
sc._gateway.jvm.org.spark.ml.util.LocaleUtils.getDefaultLocale()
    --- End diff --
    
    I was meant that if 
`sc._gateway.jvm.org.spark.ml.util.LocaleUtils.getDefaultLocale()` returns the 
same every time, shall we cache it and reuse it? But after re-thinking it, 
maybe we won't call this method with `locale is None` frequently. So it maybe 
fine.


---

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

Reply via email to